home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 5 / BBS in a Box -Volume V (BBS in a Box) (April 1992).iso / Files / Prog / M / MPWGCC (Sources).cpt / Sources / global-alloc.c < prev    next >
MacBinary  |  1990-09-04  |  34.0 KB  |  [TEXT/MPS ]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Tue Sep 4 18:32:28 1990, modified Tue Sep 4 18:32:28 1990, creator 'MPS ', type ASCII, 34167 bytes "global-alloc.c" , at 0x85f7 428 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MPS ]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0e 67 6c 6f 62 61 6c | 2d 61 6c 6c 6f 63 2e 63 |..global|-alloc.c|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 00 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 85 77 00 | 00 01 ac a3 09 db fc a3 |......w.|........|
|00000060| 09 db fc 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 89 7a 00 00 |........|.....z..|
|00000080| 2f 2a 20 41 6c 6c 6f 63 | 61 74 65 20 72 65 67 69 |/* Alloc|ate regi|
|00000090| 73 74 65 72 73 20 66 6f | 72 20 70 73 65 75 64 6f |sters fo|r pseudo|
|000000a0| 2d 72 65 67 69 73 74 65 | 72 73 20 74 68 61 74 20 |-registe|rs that |
|000000b0| 73 70 61 6e 20 62 61 73 | 69 63 20 62 6c 6f 63 6b |span bas|ic block|
|000000c0| 73 2e 0d 20 20 20 43 6f | 70 79 72 69 67 68 74 20 |s.. Co|pyright |
|000000d0| 28 43 29 20 31 39 38 37 | 2c 20 31 39 38 38 20 46 |(C) 1987|, 1988 F|
|000000e0| 72 65 65 20 53 6f 66 74 | 77 61 72 65 20 46 6f 75 |ree Soft|ware Fou|
|000000f0| 6e 64 61 74 69 6f 6e 2c | 20 49 6e 63 2e 0d 20 20 |ndation,| Inc.. |
|00000100| 20 43 6f 70 79 72 69 67 | 68 74 20 28 43 29 20 31 | Copyrig|ht (C) 1|
|00000110| 39 38 39 2c 20 31 39 39 | 30 20 41 70 70 6c 65 20 |989, 199|0 Apple |
|00000120| 43 6f 6d 70 75 74 65 72 | 2c 20 49 6e 63 2e 0d 0d |Computer|, Inc...|
|00000130| 54 68 69 73 20 66 69 6c | 65 20 69 73 20 70 61 72 |This fil|e is par|
|00000140| 74 20 6f 66 20 47 4e 55 | 20 43 43 2e 0d 0d 47 4e |t of GNU| CC...GN|
|00000150| 55 20 43 43 20 69 73 20 | 66 72 65 65 20 73 6f 66 |U CC is |free sof|
|00000160| 74 77 61 72 65 3b 20 79 | 6f 75 20 63 61 6e 20 72 |tware; y|ou can r|
|00000170| 65 64 69 73 74 72 69 62 | 75 74 65 20 69 74 20 61 |edistrib|ute it a|
|00000180| 6e 64 2f 6f 72 20 6d 6f | 64 69 66 79 0d 69 74 20 |nd/or mo|dify.it |
|00000190| 75 6e 64 65 72 20 74 68 | 65 20 74 65 72 6d 73 20 |under th|e terms |
|000001a0| 6f 66 20 74 68 65 20 47 | 4e 55 20 47 65 6e 65 72 |of the G|NU Gener|
|000001b0| 61 6c 20 50 75 62 6c 69 | 63 20 4c 69 63 65 6e 73 |al Publi|c Licens|
|000001c0| 65 20 61 73 20 70 75 62 | 6c 69 73 68 65 64 20 62 |e as pub|lished b|
|000001d0| 79 0d 74 68 65 20 46 72 | 65 65 20 53 6f 66 74 77 |y.the Fr|ee Softw|
|000001e0| 61 72 65 20 46 6f 75 6e | 64 61 74 69 6f 6e 3b 20 |are Foun|dation; |
|000001f0| 65 69 74 68 65 72 20 76 | 65 72 73 69 6f 6e 20 31 |either v|ersion 1|
|00000200| 2c 20 6f 72 20 28 61 74 | 20 79 6f 75 72 20 6f 70 |, or (at| your op|
|00000210| 74 69 6f 6e 29 0d 61 6e | 79 20 6c 61 74 65 72 20 |tion).an|y later |
|00000220| 76 65 72 73 69 6f 6e 2e | 0d 0d 47 4e 55 20 43 43 |version.|..GNU CC|
|00000230| 20 69 73 20 64 69 73 74 | 72 69 62 75 74 65 64 20 | is dist|ributed |
|00000240| 69 6e 20 74 68 65 20 68 | 6f 70 65 20 74 68 61 74 |in the h|ope that|
|00000250| 20 69 74 20 77 69 6c 6c | 20 62 65 20 75 73 65 66 | it will| be usef|
|00000260| 75 6c 2c 0d 62 75 74 20 | 57 49 54 48 4f 55 54 20 |ul,.but |WITHOUT |
|00000270| 41 4e 59 20 57 41 52 52 | 41 4e 54 59 3b 20 77 69 |ANY WARR|ANTY; wi|
|00000280| 74 68 6f 75 74 20 65 76 | 65 6e 20 74 68 65 20 69 |thout ev|en the i|
|00000290| 6d 70 6c 69 65 64 20 77 | 61 72 72 61 6e 74 79 20 |mplied w|arranty |
|000002a0| 6f 66 0d 4d 45 52 43 48 | 41 4e 54 41 42 49 4c 49 |of.MERCH|ANTABILI|
|000002b0| 54 59 20 6f 72 20 46 49 | 54 4e 45 53 53 20 46 4f |TY or FI|TNESS FO|
|000002c0| 52 20 41 20 50 41 52 54 | 49 43 55 4c 41 52 20 50 |R A PART|ICULAR P|
|000002d0| 55 52 50 4f 53 45 2e 20 | 20 53 65 65 20 74 68 65 |URPOSE. | See the|
|000002e0| 0d 47 4e 55 20 47 65 6e | 65 72 61 6c 20 50 75 62 |.GNU Gen|eral Pub|
|000002f0| 6c 69 63 20 4c 69 63 65 | 6e 73 65 20 66 6f 72 20 |lic Lice|nse for |
|00000300| 6d 6f 72 65 20 64 65 74 | 61 69 6c 73 2e 0d 0d 59 |more det|ails...Y|
|00000310| 6f 75 20 73 68 6f 75 6c | 64 20 68 61 76 65 20 72 |ou shoul|d have r|
|00000320| 65 63 65 69 76 65 64 20 | 61 20 63 6f 70 79 20 6f |eceived |a copy o|
|00000330| 66 20 74 68 65 20 47 4e | 55 20 47 65 6e 65 72 61 |f the GN|U Genera|
|00000340| 6c 20 50 75 62 6c 69 63 | 20 4c 69 63 65 6e 73 65 |l Public| License|
|00000350| 0d 61 6c 6f 6e 67 20 77 | 69 74 68 20 47 4e 55 20 |.along w|ith GNU |
|00000360| 43 43 3b 20 73 65 65 20 | 74 68 65 20 66 69 6c 65 |CC; see |the file|
|00000370| 20 43 4f 50 59 49 4e 47 | 2e 20 20 49 66 20 6e 6f | COPYING|. If no|
|00000380| 74 2c 20 77 72 69 74 65 | 20 74 6f 0d 74 68 65 20 |t, write| to.the |
|00000390| 46 72 65 65 20 53 6f 66 | 74 77 61 72 65 20 46 6f |Free Sof|tware Fo|
|000003a0| 75 6e 64 61 74 69 6f 6e | 2c 20 36 37 35 20 4d 61 |undation|, 675 Ma|
|000003b0| 73 73 20 41 76 65 2c 20 | 43 61 6d 62 72 69 64 67 |ss Ave, |Cambridg|
|000003c0| 65 2c 20 4d 41 20 30 32 | 31 33 39 2c 20 55 53 41 |e, MA 02|139, USA|
|000003d0| 2e 20 20 2a 2f 0d 0d 0d | 23 69 6e 63 6c 75 64 65 |. */...|#include|
|000003e0| 20 3c 73 74 64 69 6f 2e | 68 3e 0d 23 69 6e 63 6c | <stdio.|h>.#incl|
|000003f0| 75 64 65 20 22 63 6f 6e | 66 69 67 2e 68 22 0d 23 |ude "con|fig.h".#|
|00000400| 69 6e 63 6c 75 64 65 20 | 22 72 74 6c 2e 68 22 0d |include |"rtl.h".|
|00000410| 23 69 6e 63 6c 75 64 65 | 20 22 66 6c 61 67 73 2e |#include| "flags.|
|00000420| 68 22 0d 23 69 6e 63 6c | 75 64 65 20 22 62 61 73 |h".#incl|ude "bas|
|00000430| 69 63 2d 62 6c 6f 63 6b | 2e 68 22 0d 23 69 6e 63 |ic-block|.h".#inc|
|00000440| 6c 75 64 65 20 22 68 61 | 72 64 2d 72 65 67 2d 73 |lude "ha|rd-reg-s|
|00000450| 65 74 2e 68 22 0d 23 69 | 6e 63 6c 75 64 65 20 22 |et.h".#i|nclude "|
|00000460| 72 65 67 73 2e 68 22 0d | 23 69 6e 63 6c 75 64 65 |regs.h".|#include|
|00000470| 20 22 69 6e 73 6e 2d 63 | 6f 6e 66 69 67 2e 68 22 | "insn-c|onfig.h"|
|00000480| 0d 0d 23 69 66 64 65 66 | 20 4d 50 57 0d 23 69 6e |..#ifdef| MPW.#in|
|00000490| 63 6c 75 64 65 20 3c 43 | 75 72 73 6f 72 43 74 6c |clude <C|ursorCtl|
|000004a0| 2e 68 3e 0d 23 65 6e 64 | 69 66 0d 0d 2f 2a 20 54 |.h>.#end|if../* T|
|000004b0| 68 69 73 20 70 61 73 73 | 20 6f 66 20 74 68 65 20 |his pass| of the |
|000004c0| 63 6f 6d 70 69 6c 65 72 | 20 70 65 72 66 6f 72 6d |compiler| perform|
|000004d0| 73 20 67 6c 6f 62 61 6c | 20 72 65 67 69 73 74 65 |s global| registe|
|000004e0| 72 20 61 6c 6c 6f 63 61 | 74 69 6f 6e 2e 0d 20 20 |r alloca|tion.. |
|000004f0| 20 49 74 20 61 73 73 69 | 67 6e 73 20 68 61 72 64 | It assi|gns hard|
|00000500| 20 72 65 67 69 73 74 65 | 72 20 6e 75 6d 62 65 72 | registe|r number|
|00000510| 73 20 74 6f 20 61 6c 6c | 20 74 68 65 20 70 73 65 |s to all| the pse|
|00000520| 75 64 6f 20 72 65 67 69 | 73 74 65 72 73 0d 20 20 |udo regi|sters. |
|00000530| 20 74 68 61 74 20 77 65 | 72 65 20 6e 6f 74 20 68 | that we|re not h|
|00000540| 61 6e 64 6c 65 64 20 69 | 6e 20 6c 6f 63 61 6c 5f |andled i|n local_|
|00000550| 61 6c 6c 6f 63 2e 20 20 | 41 73 73 69 67 6e 6d 65 |alloc. |Assignme|
|00000560| 6e 74 73 20 61 72 65 20 | 72 65 63 6f 72 64 65 64 |nts are |recorded|
|00000570| 0d 20 20 20 69 6e 20 74 | 68 65 20 76 65 63 74 6f |. in t|he vecto|
|00000580| 72 20 72 65 67 5f 72 65 | 6e 75 6d 62 65 72 2c 20 |r reg_re|number, |
|00000590| 6e 6f 74 20 62 79 20 63 | 68 61 6e 67 69 6e 67 20 |not by c|hanging |
|000005a0| 74 68 65 20 72 74 6c 20 | 63 6f 64 65 2e 0d 20 20 |the rtl |code.. |
|000005b0| 20 28 53 75 63 68 20 63 | 68 61 6e 67 65 73 20 61 | (Such c|hanges a|
|000005c0| 72 65 20 6d 61 64 65 20 | 62 79 20 66 69 6e 61 6c |re made |by final|
|000005d0| 29 2e 20 20 54 68 65 20 | 65 6e 74 72 79 20 70 6f |). The |entry po|
|000005e0| 69 6e 74 20 69 73 0d 20 | 20 20 74 68 65 20 66 75 |int is. | the fu|
|000005f0| 6e 63 74 69 6f 6e 20 67 | 6c 6f 62 61 6c 5f 61 6c |nction g|lobal_al|
|00000600| 6c 6f 63 2e 0d 0d 20 20 | 20 41 66 74 65 72 20 61 |loc... | After a|
|00000610| 6c 6c 6f 63 61 74 69 6f | 6e 20 69 73 20 63 6f 6d |llocatio|n is com|
|00000620| 70 6c 65 74 65 2c 20 74 | 68 65 20 72 65 6c 6f 61 |plete, t|he reloa|
|00000630| 64 20 70 61 73 73 20 69 | 73 20 72 75 6e 20 61 73 |d pass i|s run as|
|00000640| 20 61 20 73 75 62 72 6f | 75 74 69 6e 65 0d 20 20 | a subro|utine. |
|00000650| 20 6f 66 20 74 68 69 73 | 20 70 61 73 73 2c 20 73 | of this| pass, s|
|00000660| 6f 20 74 68 61 74 20 77 | 68 65 6e 20 61 20 70 73 |o that w|hen a ps|
|00000670| 65 75 64 6f 20 72 65 67 | 20 6c 6f 73 65 73 20 69 |eudo reg| loses i|
|00000680| 74 73 20 68 61 72 64 20 | 72 65 67 20 64 75 65 20 |ts hard |reg due |
|00000690| 74 6f 0d 20 20 20 73 70 | 69 6c 6c 69 6e 67 20 69 |to. sp|illing i|
|000006a0| 74 20 69 73 20 70 6f 73 | 73 69 62 6c 65 20 74 6f |t is pos|sible to|
|000006b0| 20 6d 61 6b 65 20 61 20 | 73 65 63 6f 6e 64 20 61 | make a |second a|
|000006c0| 74 74 65 6d 70 74 20 74 | 6f 20 66 69 6e 64 20 61 |ttempt t|o find a|
|000006d0| 20 68 61 72 64 0d 20 20 | 20 72 65 67 20 66 6f 72 | hard. | reg for|
|000006e0| 20 69 74 2e 20 20 54 68 | 65 20 72 65 6c 6f 61 64 | it. Th|e reload|
|000006f0| 20 70 61 73 73 20 69 73 | 20 69 6e 64 65 70 65 6e | pass is| indepen|
|00000700| 64 65 6e 74 20 69 6e 20 | 6f 74 68 65 72 20 72 65 |dent in |other re|
|00000710| 73 70 65 63 74 73 0d 20 | 20 20 61 6e 64 20 69 74 |spects. | and it|
|00000720| 20 69 73 20 72 75 6e 20 | 65 76 65 6e 20 77 68 65 | is run |even whe|
|00000730| 6e 20 73 74 75 70 69 64 | 20 72 65 67 69 73 74 65 |n stupid| registe|
|00000740| 72 20 61 6c 6c 6f 63 61 | 74 69 6f 6e 20 69 73 20 |r alloca|tion is |
|00000750| 69 6e 20 75 73 65 2e 0d | 0d 20 20 20 31 2e 20 63 |in use..|. 1. c|
|00000760| 6f 75 6e 74 20 74 68 65 | 20 70 73 65 75 64 6f 2d |ount the| pseudo-|
|00000770| 72 65 67 69 73 74 65 72 | 73 20 73 74 69 6c 6c 20 |register|s still |
|00000780| 6e 65 65 64 69 6e 67 20 | 61 6c 6c 6f 63 61 74 69 |needing |allocati|
|00000790| 6f 6e 0d 20 20 20 61 6e | 64 20 61 73 73 69 67 6e |on. an|d assign|
|000007a0| 20 61 6c 6c 6f 63 61 74 | 69 6f 6e 2d 6e 75 6d 62 | allocat|ion-numb|
|000007b0| 65 72 73 20 28 61 6c 6c | 6f 63 6e 6f 73 29 20 74 |ers (all|ocnos) t|
|000007c0| 6f 20 74 68 65 6d 2e 0d | 20 20 20 53 65 74 20 75 |o them..| Set u|
|000007d0| 70 20 74 61 62 6c 65 73 | 20 72 65 67 5f 61 6c 6c |p tables| reg_all|
|000007e0| 6f 63 6e 6f 20 61 6e 64 | 20 61 6c 6c 6f 63 6e 6f |ocno and| allocno|
|000007f0| 5f 72 65 67 20 74 6f 20 | 6d 61 70 20 0d 20 20 20 |_reg to |map . |
|00000800| 72 65 67 20 6e 75 6d 62 | 65 72 73 20 74 6f 20 61 |reg numb|ers to a|
|00000810| 6c 6c 6f 63 6e 6f 73 20 | 61 6e 64 20 76 69 63 65 |llocnos |and vice|
|00000820| 20 76 65 72 73 61 2e 0d | 20 20 20 6d 61 78 5f 61 | versa..| max_a|
|00000830| 6c 6c 6f 63 6e 6f 20 67 | 65 74 73 20 74 68 65 20 |llocno g|ets the |
|00000840| 6e 75 6d 62 65 72 20 6f | 66 20 61 6c 6c 6f 63 6e |number o|f allocn|
|00000850| 6f 73 20 69 6e 20 75 73 | 65 2e 0d 0d 20 20 20 32 |os in us|e... 2|
|00000860| 2e 20 41 6c 6c 6f 63 61 | 74 65 20 61 20 6d 61 78 |. Alloca|te a max|
|00000870| 5f 61 6c 6c 6f 63 6e 6f | 20 62 79 20 6d 61 78 5f |_allocno| by max_|
|00000880| 61 6c 6c 6f 63 6e 6f 20 | 63 6f 6e 66 6c 69 63 74 |allocno |conflict|
|00000890| 20 62 69 74 20 6d 61 74 | 72 69 78 20 61 6e 64 20 | bit mat|rix and |
|000008a0| 63 6c 65 61 72 20 69 74 | 2e 0d 20 20 20 41 6c 6c |clear it|.. All|
|000008b0| 6f 63 61 74 65 20 61 20 | 6d 61 78 5f 61 6c 6c 6f |ocate a |max_allo|
|000008c0| 63 6e 6f 20 62 79 20 46 | 49 52 53 54 5f 50 53 45 |cno by F|IRST_PSE|
|000008d0| 55 44 4f 5f 52 45 47 49 | 53 54 45 52 20 63 6f 6e |UDO_REGI|STER con|
|000008e0| 66 6c 69 63 74 20 6d 61 | 74 72 69 78 0d 20 20 20 |flict ma|trix. |
|000008f0| 66 6f 72 20 63 6f 6e 66 | 6c 69 63 74 73 20 62 65 |for conf|licts be|
|00000900| 74 77 65 65 6e 20 61 6c | 6c 6f 63 6e 6f 73 20 61 |tween al|locnos a|
|00000910| 6e 64 20 65 78 70 6c 69 | 63 69 74 20 68 61 72 64 |nd expli|cit hard|
|00000920| 20 72 65 67 69 73 74 65 | 72 20 75 73 65 0d 20 20 | registe|r use. |
|00000930| 20 28 77 68 69 63 68 20 | 69 6e 63 6c 75 64 65 73 | (which |includes|
|00000940| 20 75 73 65 20 6f 66 20 | 70 73 65 75 64 6f 2d 72 | use of |pseudo-r|
|00000950| 65 67 69 73 74 65 72 73 | 20 61 6c 6c 6f 63 61 74 |egisters| allocat|
|00000960| 65 64 20 62 79 20 6c 6f | 63 61 6c 5f 61 6c 6c 6f |ed by lo|cal_allo|
|00000970| 63 29 2e 0d 0d 20 20 20 | 33 2e 20 66 6f 72 20 65 |c)... |3. for e|
|00000980| 61 63 68 20 62 61 73 69 | 63 20 62 6c 6f 63 6b 0d |ach basi|c block.|
|00000990| 20 20 20 20 77 61 6c 6b | 20 66 6f 72 77 61 72 64 | walk| forward|
|000009a0| 20 74 68 72 6f 75 67 68 | 20 74 68 65 20 62 6c 6f | through| the blo|
|000009b0| 63 6b 2c 20 72 65 63 6f | 72 64 69 6e 67 20 77 68 |ck, reco|rding wh|
|000009c0| 69 63 68 0d 20 20 20 20 | 75 6e 61 6c 6c 6f 63 61 |ich. |unalloca|
|000009d0| 74 65 64 20 72 65 67 69 | 73 74 65 72 73 20 61 6e |ted regi|sters an|
|000009e0| 64 20 77 68 69 63 68 20 | 68 61 72 64 77 61 72 65 |d which |hardware|
|000009f0| 20 72 65 67 69 73 74 65 | 72 73 20 61 72 65 20 6c | registe|rs are l|
|00000a00| 69 76 65 2e 0d 20 20 20 | 20 42 75 69 6c 64 20 74 |ive.. | Build t|
|00000a10| 68 65 20 63 6f 6e 66 6c | 69 63 74 20 6d 61 74 72 |he confl|ict matr|
|00000a20| 69 78 20 62 65 74 77 65 | 65 6e 20 74 68 65 20 75 |ix betwe|en the u|
|00000a30| 6e 61 6c 6c 6f 63 61 74 | 65 64 20 72 65 67 69 73 |nallocat|ed regis|
|00000a40| 74 65 72 73 0d 20 20 20 | 20 61 6e 64 20 61 6e 6f |ters. | and ano|
|00000a50| 74 68 65 72 20 6f 66 20 | 75 6e 61 6c 6c 6f 63 61 |ther of |unalloca|
|00000a60| 74 65 64 20 72 65 67 69 | 73 74 65 72 73 20 76 65 |ted regi|sters ve|
|00000a70| 72 73 75 73 20 68 61 72 | 64 77 61 72 65 20 72 65 |rsus har|dware re|
|00000a80| 67 69 73 74 65 72 73 2e | 0d 20 20 20 20 41 6c 73 |gisters.|. Als|
|00000a90| 6f 20 72 65 63 6f 72 64 | 20 74 68 65 20 70 72 65 |o record| the pre|
|00000aa0| 66 65 72 72 65 64 20 68 | 61 72 64 77 61 72 65 20 |ferred h|ardware |
|00000ab0| 72 65 67 69 73 74 65 72 | 73 0d 20 20 20 20 66 6f |register|s. fo|
|00000ac0| 72 20 65 61 63 68 20 75 | 6e 61 6c 6c 6f 63 61 74 |r each u|nallocat|
|00000ad0| 65 64 20 6f 6e 65 2e 0d | 0d 20 20 20 34 2e 20 53 |ed one..|. 4. S|
|00000ae0| 6f 72 74 20 61 20 74 61 | 62 6c 65 20 6f 66 20 74 |ort a ta|ble of t|
|00000af0| 68 65 20 61 6c 6c 6f 63 | 6e 6f 73 20 69 6e 74 6f |he alloc|nos into|
|00000b00| 20 6f 72 64 65 72 20 6f | 66 0d 20 20 20 64 65 73 | order o|f. des|
|00000b10| 69 72 61 62 69 6c 69 74 | 79 20 6f 66 20 74 68 65 |irabilit|y of the|
|00000b20| 20 76 61 72 69 61 62 6c | 65 73 2e 0d 0d 20 20 20 | variabl|es... |
|00000b30| 35 2e 20 41 6c 6c 6f 63 | 61 74 65 20 74 68 65 20 |5. Alloc|ate the |
|00000b40| 76 61 72 69 61 62 6c 65 | 73 20 69 6e 20 74 68 61 |variable|s in tha|
|00000b50| 74 20 6f 72 64 65 72 3b | 20 65 61 63 68 20 69 66 |t order;| each if|
|00000b60| 20 70 6f 73 73 69 62 6c | 65 20 69 6e 74 6f 0d 20 | possibl|e into. |
|00000b70| 20 20 61 20 70 72 65 66 | 65 72 72 65 64 20 72 65 | a pref|erred re|
|00000b80| 67 69 73 74 65 72 2c 20 | 65 6c 73 65 20 69 6e 74 |gister, |else int|
|00000b90| 6f 20 61 6e 6f 74 68 65 | 72 20 72 65 67 69 73 74 |o anothe|r regist|
|00000ba0| 65 72 2e 20 20 2a 2f 0d | 0c 0d 2f 2a 20 4e 75 6d |er. */.|../* Num|
|00000bb0| 62 65 72 20 6f 66 20 70 | 73 65 75 64 6f 2d 72 65 |ber of p|seudo-re|
|00000bc0| 67 69 73 74 65 72 73 20 | 73 74 69 6c 6c 20 72 65 |gisters |still re|
|00000bd0| 71 75 69 72 69 6e 67 20 | 61 6c 6c 6f 63 61 74 69 |quiring |allocati|
|00000be0| 6f 6e 0d 20 20 20 28 6e | 6f 74 20 61 6c 6c 6f 63 |on. (n|ot alloc|
|00000bf0| 61 74 65 64 20 62 79 20 | 6c 6f 63 61 6c 5f 61 6c |ated by |local_al|
|00000c00| 6c 6f 63 61 74 65 29 2e | 20 20 2a 2f 0d 0d 73 74 |locate).| */..st|
|00000c10| 61 74 69 63 20 69 6e 74 | 20 6d 61 78 5f 61 6c 6c |atic int| max_all|
|00000c20| 6f 63 6e 6f 3b 0d 0d 2f | 2a 20 49 6e 64 65 78 65 |ocno;../|* Indexe|
|00000c30| 64 20 62 79 20 28 70 73 | 65 75 64 6f 29 20 72 65 |d by (ps|eudo) re|
|00000c40| 67 20 6e 75 6d 62 65 72 | 2c 20 67 69 76 65 73 20 |g number|, gives |
|00000c50| 74 68 65 20 61 6c 6c 6f | 63 6e 6f 2c 20 6f 72 20 |the allo|cno, or |
|00000c60| 2d 31 0d 20 20 20 66 6f | 72 20 70 73 65 75 64 6f |-1. fo|r pseudo|
|00000c70| 20 72 65 67 69 73 74 65 | 72 73 20 61 6c 72 65 61 | registe|rs alrea|
|00000c80| 64 79 20 61 6c 6c 6f 63 | 61 74 65 64 20 62 79 20 |dy alloc|ated by |
|00000c90| 6c 6f 63 61 6c 5f 61 6c | 6c 6f 63 61 74 65 2e 20 |local_al|locate. |
|00000ca0| 20 2a 2f 0d 0d 73 74 61 | 74 69 63 20 69 6e 74 20 | */..sta|tic int |
|00000cb0| 2a 72 65 67 5f 61 6c 6c | 6f 63 6e 6f 3b 0d 0d 2f |*reg_all|ocno;../|
|00000cc0| 2a 20 49 6e 64 65 78 65 | 64 20 62 79 20 61 6c 6c |* Indexe|d by all|
|00000cd0| 6f 63 6e 6f 2c 20 67 69 | 76 65 73 20 74 68 65 20 |ocno, gi|ves the |
|00000ce0| 72 65 67 20 6e 75 6d 62 | 65 72 2e 20 20 2a 2f 0d |reg numb|er. */.|
|00000cf0| 0d 73 74 61 74 69 63 20 | 69 6e 74 20 2a 61 6c 6c |.static |int *all|
|00000d00| 6f 63 6e 6f 5f 72 65 67 | 3b 0d 0d 2f 2a 20 41 20 |ocno_reg|;../* A |
|00000d10| 76 65 63 74 6f 72 20 6f | 66 20 74 68 65 20 69 6e |vector o|f the in|
|00000d20| 74 65 67 65 72 73 20 66 | 72 6f 6d 20 30 20 74 6f |tegers f|rom 0 to|
|00000d30| 20 6d 61 78 5f 61 6c 6c | 6f 63 6e 6f 2d 31 2c 0d | max_all|ocno-1,.|
|00000d40| 20 20 20 73 6f 72 74 65 | 64 20 69 6e 20 74 68 65 | sorte|d in the|
|00000d50| 20 6f 72 64 65 72 20 6f | 66 20 66 69 72 73 74 2d | order o|f first-|
|00000d60| 74 6f 2d 62 65 2d 61 6c | 6c 6f 63 61 74 65 64 20 |to-be-al|located |
|00000d70| 66 69 72 73 74 2e 20 20 | 2a 2f 0d 0d 73 74 61 74 |first. |*/..stat|
|00000d80| 69 63 20 69 6e 74 20 2a | 61 6c 6c 6f 63 6e 6f 5f |ic int *|allocno_|
|00000d90| 6f 72 64 65 72 3b 0d 0d | 2f 2a 20 49 6e 64 65 78 |order;..|/* Index|
|00000da0| 65 64 20 62 79 20 61 6e | 20 61 6c 6c 6f 63 6e 6f |ed by an| allocno|
|00000db0| 2c 20 67 69 76 65 73 20 | 74 68 65 20 6e 75 6d 62 |, gives |the numb|
|00000dc0| 65 72 20 6f 66 20 63 6f | 6e 73 65 63 75 74 69 76 |er of co|nsecutiv|
|00000dd0| 65 0d 20 20 20 68 61 72 | 64 20 72 65 67 69 73 74 |e. har|d regist|
|00000de0| 65 72 73 20 6e 65 65 64 | 65 64 20 62 79 20 74 68 |ers need|ed by th|
|00000df0| 61 74 20 70 73 65 75 64 | 6f 20 72 65 67 2e 20 20 |at pseud|o reg. |
|00000e00| 2a 2f 0d 0d 73 74 61 74 | 69 63 20 69 6e 74 20 2a |*/..stat|ic int *|
|00000e10| 61 6c 6c 6f 63 6e 6f 5f | 73 69 7a 65 3b 0d 0d 2f |allocno_|size;../|
|00000e20| 2a 20 6d 61 78 5f 61 6c | 6c 6f 63 6e 6f 20 62 79 |* max_al|locno by|
|00000e30| 20 6d 61 78 5f 61 6c 6c | 6f 63 6e 6f 20 61 72 72 | max_all|ocno arr|
|00000e40| 61 79 20 6f 66 20 62 69 | 74 73 2c 0d 20 20 20 72 |ay of bi|ts,. r|
|00000e50| 65 63 6f 72 64 69 6e 67 | 20 77 68 65 74 68 65 72 |ecording| whether|
|00000e60| 20 74 77 6f 20 61 6c 6c | 6f 63 6e 6f 27 73 20 63 | two all|ocno's c|
|00000e70| 6f 6e 66 6c 69 63 74 20 | 28 63 61 6e 27 74 20 67 |onflict |(can't g|
|00000e80| 6f 20 69 6e 20 74 68 65 | 20 73 61 6d 65 0d 20 20 |o in the| same. |
|00000e90| 20 68 61 72 64 77 61 72 | 65 20 72 65 67 69 73 74 | hardwar|e regist|
|00000ea0| 65 72 29 2e 0d 0d 20 20 | 20 60 63 6f 6e 66 6c 69 |er)... | `confli|
|00000eb0| 63 74 73 27 20 69 73 20 | 6e 6f 74 20 73 79 6d 6d |cts' is |not symm|
|00000ec0| 65 74 72 69 63 3b 20 61 | 20 63 6f 6e 66 6c 69 63 |etric; a| conflic|
|00000ed0| 74 20 62 65 74 77 65 65 | 6e 20 61 6c 6c 6f 63 6e |t betwee|n allocn|
|00000ee0| 6f 27 73 20 69 20 61 6e | 64 20 6a 0d 20 20 20 69 |o's i an|d j. i|
|00000ef0| 73 20 72 65 63 6f 72 64 | 65 64 20 65 69 74 68 65 |s record|ed eithe|
|00000f00| 72 20 69 6e 20 65 6c 65 | 6d 65 6e 74 20 69 2c 6a |r in ele|ment i,j|
|00000f10| 20 6f 72 20 69 6e 20 65 | 6c 65 6d 65 6e 74 20 6a | or in e|lement j|
|00000f20| 2c 69 2e 20 20 2a 2f 0d | 0d 73 74 61 74 69 63 20 |,i. */.|.static |
|00000f30| 69 6e 74 20 2a 63 6f 6e | 66 6c 69 63 74 73 3b 0d |int *con|flicts;.|
|00000f40| 0d 2f 2a 20 4e 75 6d 62 | 65 72 20 6f 66 20 69 6e |./* Numb|er of in|
|00000f50| 74 73 20 72 65 71 75 69 | 72 65 20 74 6f 20 68 6f |ts requi|re to ho|
|00000f60| 6c 64 20 6d 61 78 5f 61 | 6c 6c 6f 63 6e 6f 20 62 |ld max_a|llocno b|
|00000f70| 69 74 73 2e 0d 20 20 20 | 54 68 69 73 20 69 73 20 |its.. |This is |
|00000f80| 74 68 65 20 6c 65 6e 67 | 74 68 20 6f 66 20 61 20 |the leng|th of a |
|00000f90| 72 6f 77 20 69 6e 20 60 | 63 6f 6e 66 6c 69 63 74 |row in `|conflict|
|00000fa0| 73 27 2e 20 20 2a 2f 0d | 0d 73 74 61 74 69 63 20 |s'. */.|.static |
|00000fb0| 69 6e 74 20 61 6c 6c 6f | 63 6e 6f 5f 72 6f 77 5f |int allo|cno_row_|
|00000fc0| 77 6f 72 64 73 3b 0d 0d | 2f 2a 20 54 77 6f 20 6d |words;..|/* Two m|
|00000fd0| 61 63 72 6f 73 20 74 6f | 20 74 65 73 74 20 6f 72 |acros to| test or|
|00000fe0| 20 73 74 6f 72 65 20 31 | 20 69 6e 20 61 6e 20 65 | store 1| in an e|
|00000ff0| 6c 65 6d 65 6e 74 20 6f | 66 20 60 63 6f 6e 66 6c |lement o|f `confl|
|00001000| 69 63 74 73 27 2e 20 20 | 2a 2f 0d 0d 23 64 65 66 |icts'. |*/..#def|
|00001010| 69 6e 65 20 43 4f 4e 46 | 4c 49 43 54 50 28 49 2c |ine CONF|LICTP(I,|
|00001020| 20 4a 29 20 5c 0d 20 28 | 63 6f 6e 66 6c 69 63 74 | J) \. (|conflict|
|00001030| 73 5b 28 49 29 20 2a 20 | 61 6c 6c 6f 63 6e 6f 5f |s[(I) * |allocno_|
|00001040| 72 6f 77 5f 77 6f 72 64 | 73 20 2b 20 28 4a 29 20 |row_word|s + (J) |
|00001050| 2f 20 49 4e 54 5f 42 49 | 54 53 5d 09 5c 0d 20 20 |/ INT_BI|TS].\. |
|00001060| 26 20 28 31 20 3c 3c 20 | 28 28 4a 29 20 25 20 49 |& (1 << |((J) % I|
|00001070| 4e 54 5f 42 49 54 53 29 | 29 29 0d 0d 23 64 65 66 |NT_BITS)|))..#def|
|00001080| 69 6e 65 20 53 45 54 5f | 43 4f 4e 46 4c 49 43 54 |ine SET_|CONFLICT|
|00001090| 28 49 2c 20 4a 29 20 5c | 0d 20 28 63 6f 6e 66 6c |(I, J) \|. (confl|
|000010a0| 69 63 74 73 5b 28 49 29 | 20 2a 20 61 6c 6c 6f 63 |icts[(I)| * alloc|
|000010b0| 6e 6f 5f 72 6f 77 5f 77 | 6f 72 64 73 20 2b 20 28 |no_row_w|ords + (|
|000010c0| 4a 29 20 2f 20 49 4e 54 | 5f 42 49 54 53 5d 09 5c |J) / INT|_BITS].\|
|000010d0| 0d 20 20 7c 3d 20 28 31 | 20 3c 3c 20 28 28 4a 29 |. |= (1| << ((J)|
|000010e0| 20 25 20 49 4e 54 5f 42 | 49 54 53 29 29 29 0d 0d | % INT_B|ITS)))..|
|000010f0| 2f 2a 20 53 65 74 20 6f | 66 20 68 61 72 64 20 72 |/* Set o|f hard r|
|00001100| 65 67 73 20 63 75 72 72 | 65 6e 74 6c 79 20 6c 69 |egs curr|ently li|
|00001110| 76 65 20 28 64 75 72 69 | 6e 67 20 73 63 61 6e 20 |ve (duri|ng scan |
|00001120| 6f 66 20 61 6c 6c 20 69 | 6e 73 6e 73 29 2e 20 20 |of all i|nsns). |
|00001130| 2a 2f 0d 0d 73 74 61 74 | 69 63 20 48 41 52 44 5f |*/..stat|ic HARD_|
|00001140| 52 45 47 5f 53 45 54 20 | 68 61 72 64 5f 72 65 67 |REG_SET |hard_reg|
|00001150| 73 5f 6c 69 76 65 3b 0d | 0d 2f 2a 20 49 6e 64 65 |s_live;.|./* Inde|
|00001160| 78 65 64 20 62 79 20 4e | 2c 20 73 65 74 20 6f 66 |xed by N|, set of|
|00001170| 20 68 61 72 64 20 72 65 | 67 73 20 63 6f 6e 66 6c | hard re|gs confl|
|00001180| 69 63 74 69 6e 67 20 77 | 69 74 68 20 61 6c 6c 6f |icting w|ith allo|
|00001190| 63 6e 6f 20 4e 2e 20 20 | 2a 2f 0d 0d 73 74 61 74 |cno N. |*/..stat|
|000011a0| 69 63 20 48 41 52 44 5f | 52 45 47 5f 53 45 54 20 |ic HARD_|REG_SET |
|000011b0| 2a 68 61 72 64 5f 72 65 | 67 5f 63 6f 6e 66 6c 69 |*hard_re|g_confli|
|000011c0| 63 74 73 3b 0d 0d 2f 2a | 20 49 6e 64 65 78 65 64 |cts;../*| Indexed|
|000011d0| 20 62 79 20 4e 2c 20 73 | 65 74 20 6f 66 20 68 61 | by N, s|et of ha|
|000011e0| 72 64 20 72 65 67 73 20 | 70 72 65 66 65 72 72 65 |rd regs |preferre|
|000011f0| 64 20 62 79 20 61 6c 6c | 6f 63 6e 6f 20 4e 2e 0d |d by all|ocno N..|
|00001200| 20 20 20 54 68 69 73 20 | 69 73 20 75 73 65 64 20 | This |is used |
|00001210| 74 6f 20 6d 61 6b 65 20 | 61 6c 6c 6f 63 6e 6f 73 |to make |allocnos|
|00001220| 20 67 6f 20 69 6e 74 6f | 20 72 65 67 73 20 74 68 | go into| regs th|
|00001230| 61 74 20 61 72 65 20 63 | 6f 70 69 65 64 20 74 6f |at are c|opied to|
|00001240| 20 6f 72 20 66 72 6f 6d | 20 74 68 65 6d 2c 0d 20 | or from| them,. |
|00001250| 20 20 77 68 65 6e 20 70 | 6f 73 73 69 62 6c 65 2c | when p|ossible,|
|00001260| 20 74 6f 20 72 65 64 75 | 63 65 20 72 65 67 69 73 | to redu|ce regis|
|00001270| 74 65 72 20 73 68 75 66 | 66 6c 69 6e 67 2e 20 20 |ter shuf|fling. |
|00001280| 2a 2f 0d 0d 73 74 61 74 | 69 63 20 48 41 52 44 5f |*/..stat|ic HARD_|
|00001290| 52 45 47 5f 53 45 54 20 | 2a 68 61 72 64 5f 72 65 |REG_SET |*hard_re|
|000012a0| 67 5f 70 72 65 66 65 72 | 65 6e 63 65 73 3b 0d 0d |g_prefer|ences;..|
|000012b0| 2f 2a 20 53 65 74 20 6f | 66 20 72 65 67 69 73 74 |/* Set o|f regist|
|000012c0| 65 72 73 20 74 68 61 74 | 20 73 6f 6d 65 20 61 6c |ers that| some al|
|000012d0| 6c 6f 63 6e 6f 20 68 61 | 73 20 61 20 70 72 65 66 |locno ha|s a pref|
|000012e0| 65 72 65 6e 63 65 20 66 | 6f 72 2e 20 20 2a 2f 0d |erence f|or. */.|
|000012f0| 0d 73 74 61 74 69 63 20 | 48 41 52 44 5f 52 45 47 |.static |HARD_REG|
|00001300| 5f 53 45 54 20 72 65 67 | 73 5f 73 6f 6d 65 6f 6e |_SET reg|s_someon|
|00001310| 65 5f 70 72 65 66 65 72 | 73 3b 0d 0d 2f 2a 20 53 |e_prefer|s;../* S|
|00001320| 65 74 20 6f 66 20 72 65 | 67 69 73 74 65 72 73 20 |et of re|gisters |
|00001330| 74 68 61 74 20 67 6c 6f | 62 61 6c 2d 61 6c 6c 6f |that glo|bal-allo|
|00001340| 63 20 69 73 6e 27 74 20 | 73 75 70 70 6f 73 65 64 |c isn't |supposed|
|00001350| 20 74 6f 20 75 73 65 2e | 20 20 2a 2f 0d 0d 73 74 | to use.| */..st|
|00001360| 61 74 69 63 20 48 41 52 | 44 5f 52 45 47 5f 53 45 |atic HAR|D_REG_SE|
|00001370| 54 20 6e 6f 5f 67 6c 6f | 62 61 6c 5f 61 6c 6c 6f |T no_glo|bal_allo|
|00001380| 63 5f 72 65 67 73 3b 0d | 0d 2f 2a 20 54 65 73 74 |c_regs;.|./* Test|
|00001390| 20 61 20 62 69 74 20 69 | 6e 20 54 41 42 4c 45 2c | a bit i|n TABLE,|
|000013a0| 20 61 20 76 65 63 74 6f | 72 20 6f 66 20 48 41 52 | a vecto|r of HAR|
|000013b0| 44 5f 52 45 47 5f 53 45 | 54 73 2c 0d 20 20 20 66 |D_REG_SE|Ts,. f|
|000013c0| 6f 72 20 76 65 63 74 6f | 72 20 65 6c 65 6d 65 6e |or vecto|r elemen|
|000013d0| 74 20 49 2c 20 61 6e 64 | 20 68 61 72 64 20 72 65 |t I, and| hard re|
|000013e0| 67 69 73 74 65 72 20 6e | 75 6d 62 65 72 20 4a 2e |gister n|umber J.|
|000013f0| 20 20 2a 2f 0d 0d 23 64 | 65 66 69 6e 65 20 52 45 | */..#d|efine RE|
|00001400| 47 42 49 54 50 28 54 41 | 42 4c 45 2c 20 49 2c 20 |GBITP(TA|BLE, I, |
|00001410| 4a 29 20 20 20 20 20 54 | 45 53 54 5f 48 41 52 44 |J) T|EST_HARD|
|00001420| 5f 52 45 47 5f 42 49 54 | 20 28 54 41 42 4c 45 5b |_REG_BIT| (TABLE[|
|00001430| 49 5d 2c 20 4a 29 0d 0d | 2f 2a 20 53 65 74 20 74 |I], J)..|/* Set t|
|00001440| 6f 20 31 20 61 20 62 69 | 74 20 69 6e 20 61 20 76 |o 1 a bi|t in a v|
|00001450| 65 63 74 6f 72 20 6f 66 | 20 48 41 52 44 5f 52 45 |ector of| HARD_RE|
|00001460| 47 5f 53 45 54 73 2e 20 | 20 57 6f 72 6b 73 20 6c |G_SETs. | Works l|
|00001470| 69 6b 65 20 52 45 47 42 | 49 54 50 2e 20 20 2a 2f |ike REGB|ITP. */|
|00001480| 0d 0d 23 64 65 66 69 6e | 65 20 53 45 54 5f 52 45 |..#defin|e SET_RE|
|00001490| 47 42 49 54 28 54 41 42 | 4c 45 2c 20 49 2c 20 4a |GBIT(TAB|LE, I, J|
|000014a0| 29 20 20 53 45 54 5f 48 | 41 52 44 5f 52 45 47 5f |) SET_H|ARD_REG_|
|000014b0| 42 49 54 20 28 54 41 42 | 4c 45 5b 49 5d 2c 20 4a |BIT (TAB|LE[I], J|
|000014c0| 29 0d 0d 2f 2a 20 42 69 | 74 20 6d 61 73 6b 20 66 |)../* Bi|t mask f|
|000014d0| 6f 72 20 61 6c 6c 6f 63 | 6e 6f 73 20 6c 69 76 65 |or alloc|nos live|
|000014e0| 20 61 74 20 63 75 72 72 | 65 6e 74 20 70 6f 69 6e | at curr|ent poin|
|000014f0| 74 20 69 6e 20 74 68 65 | 20 73 63 61 6e 2e 20 20 |t in the| scan. |
|00001500| 2a 2f 0d 0d 73 74 61 74 | 69 63 20 69 6e 74 20 2a |*/..stat|ic int *|
|00001510| 61 6c 6c 6f 63 6e 6f 73 | 5f 6c 69 76 65 3b 0d 0d |allocnos|_live;..|
|00001520| 23 64 65 66 69 6e 65 20 | 49 4e 54 5f 42 49 54 53 |#define |INT_BITS|
|00001530| 20 48 4f 53 54 5f 42 49 | 54 53 5f 50 45 52 5f 49 | HOST_BI|TS_PER_I|
|00001540| 4e 54 0d 0d 2f 2a 20 54 | 65 73 74 2c 20 73 65 74 |NT../* T|est, set|
|00001550| 20 6f 72 20 63 6c 65 61 | 72 20 62 69 74 20 6e 75 | or clea|r bit nu|
|00001560| 6d 62 65 72 20 49 20 69 | 6e 20 61 6c 6c 6f 63 6e |mber I i|n allocn|
|00001570| 6f 73 5f 6c 69 76 65 2c | 0d 20 20 20 61 20 62 69 |os_live,|. a bi|
|00001580| 74 20 76 65 63 74 6f 72 | 20 69 6e 64 65 78 65 64 |t vector| indexed|
|00001590| 20 62 79 20 61 6c 6c 6f | 63 6e 6f 2e 20 20 2a 2f | by allo|cno. */|
|000015a0| 0d 0d 23 64 65 66 69 6e | 65 20 41 4c 4c 4f 43 4e |..#defin|e ALLOCN|
|000015b0| 4f 5f 4c 49 56 45 5f 50 | 28 49 29 20 5c 0d 20 20 |O_LIVE_P|(I) \. |
|000015c0| 28 61 6c 6c 6f 63 6e 6f | 73 5f 6c 69 76 65 5b 28 |(allocno|s_live[(|
|000015d0| 49 29 20 2f 20 49 4e 54 | 5f 42 49 54 53 5d 20 26 |I) / INT|_BITS] &|
|000015e0| 20 28 31 20 3c 3c 20 28 | 28 49 29 20 25 20 49 4e | (1 << (|(I) % IN|
|000015f0| 54 5f 42 49 54 53 29 29 | 29 0d 0d 23 64 65 66 69 |T_BITS))|)..#defi|
|00001600| 6e 65 20 53 45 54 5f 41 | 4c 4c 4f 43 4e 4f 5f 4c |ne SET_A|LLOCNO_L|
|00001610| 49 56 45 28 49 29 20 5c | 0d 20 20 28 61 6c 6c 6f |IVE(I) \|. (allo|
|00001620| 63 6e 6f 73 5f 6c 69 76 | 65 5b 28 49 29 20 2f 20 |cnos_liv|e[(I) / |
|00001630| 49 4e 54 5f 42 49 54 53 | 5d 20 7c 3d 20 28 31 20 |INT_BITS|] |= (1 |
|00001640| 3c 3c 20 28 28 49 29 20 | 25 20 49 4e 54 5f 42 49 |<< ((I) |% INT_BI|
|00001650| 54 53 29 29 29 0d 0d 23 | 64 65 66 69 6e 65 20 43 |TS)))..#|define C|
|00001660| 4c 45 41 52 5f 41 4c 4c | 4f 43 4e 4f 5f 4c 49 56 |LEAR_ALL|OCNO_LIV|
|00001670| 45 28 49 29 20 5c 0d 20 | 20 28 61 6c 6c 6f 63 6e |E(I) \. | (allocn|
|00001680| 6f 73 5f 6c 69 76 65 5b | 28 49 29 20 2f 20 49 4e |os_live[|(I) / IN|
|00001690| 54 5f 42 49 54 53 5d 20 | 26 3d 20 7e 28 31 20 3c |T_BITS] |&= ~(1 <|
|000016a0| 3c 20 28 28 49 29 20 25 | 20 49 4e 54 5f 42 49 54 |< ((I) %| INT_BIT|
|000016b0| 53 29 29 29 0d 0d 2f 2a | 20 52 65 63 6f 72 64 20 |S)))../*| Record |
|000016c0| 61 6c 6c 20 72 65 67 73 | 20 74 68 61 74 20 61 72 |all regs| that ar|
|000016d0| 65 20 73 65 74 20 69 6e | 20 61 6e 79 20 6f 6e 65 |e set in| any one|
|000016e0| 20 69 6e 73 6e 2e 0d 20 | 20 20 43 6f 6d 6d 75 6e | insn.. | Commun|
|000016f0| 69 63 61 74 69 6f 6e 20 | 66 72 6f 6d 20 6d 61 72 |ication |from mar|
|00001700| 6b 5f 72 65 67 5f 7b 73 | 74 6f 72 65 2c 63 6c 6f |k_reg_{s|tore,clo|
|00001710| 62 62 65 72 7d 20 61 6e | 64 20 67 6c 6f 62 61 6c |bber} an|d global|
|00001720| 5f 63 6f 6e 66 6c 69 63 | 74 73 2e 20 20 2a 2f 0d |_conflic|ts. */.|
|00001730| 0d 73 74 61 74 69 63 20 | 72 74 78 20 2a 72 65 67 |.static |rtx *reg|
|00001740| 73 5f 73 65 74 3b 0d 73 | 74 61 74 69 63 20 69 6e |s_set;.s|tatic in|
|00001750| 74 20 6e 5f 72 65 67 73 | 5f 73 65 74 3b 0d 0d 73 |t n_regs|_set;..s|
|00001760| 74 61 74 69 63 20 69 6e | 74 20 61 6c 6c 6f 63 6e |tatic in|t allocn|
|00001770| 6f 5f 63 6f 6d 70 61 72 | 65 20 28 29 3b 0d 73 74 |o_compar|e ();.st|
|00001780| 61 74 69 63 20 76 6f 69 | 64 20 6d 61 72 6b 5f 72 |atic voi|d mark_r|
|00001790| 65 67 5f 73 74 6f 72 65 | 20 28 29 3b 0d 73 74 61 |eg_store| ();.sta|
|000017a0| 74 69 63 20 76 6f 69 64 | 20 6d 61 72 6b 5f 72 65 |tic void| mark_re|
|000017b0| 67 5f 63 6c 6f 62 62 65 | 72 20 28 29 3b 0d 73 74 |g_clobbe|r ();.st|
|000017c0| 61 74 69 63 20 76 6f 69 | 64 20 6d 61 72 6b 5f 72 |atic voi|d mark_r|
|000017d0| 65 67 5f 6c 69 76 65 5f | 6e 63 20 28 29 3b 0d 73 |eg_live_|nc ();.s|
|000017e0| 74 61 74 69 63 20 76 6f | 69 64 20 6d 61 72 6b 5f |tatic vo|id mark_|
|000017f0| 72 65 67 5f 64 65 61 74 | 68 20 28 29 3b 0d 73 74 |reg_deat|h ();.st|
|00001800| 61 74 69 63 20 76 6f 69 | 64 20 64 75 6d 70 5f 63 |atic voi|d dump_c|
|00001810| 6f 6e 66 6c 69 63 74 73 | 20 28 29 3b 0d 73 74 61 |onflicts| ();.sta|
|00001820| 74 69 63 20 76 6f 69 64 | 20 66 69 6e 64 5f 72 65 |tic void| find_re|
|00001830| 67 20 28 29 3b 0d 73 74 | 61 74 69 63 20 76 6f 69 |g ();.st|atic voi|
|00001840| 64 20 67 6c 6f 62 61 6c | 5f 63 6f 6e 66 6c 69 63 |d global|_conflic|
|00001850| 74 73 20 28 29 3b 0d 73 | 74 61 74 69 63 20 76 6f |ts ();.s|tatic vo|
|00001860| 69 64 20 72 65 63 6f 72 | 64 5f 63 6f 6e 66 6c 69 |id recor|d_confli|
|00001870| 63 74 73 20 28 29 3b 0d | 73 74 61 74 69 63 20 76 |cts ();.|static v|
|00001880| 6f 69 64 20 73 65 74 5f | 70 72 65 66 65 72 65 6e |oid set_|preferen|
|00001890| 63 65 20 28 29 3b 0d 0c | 0d 2f 2a 20 50 65 72 66 |ce ();..|./* Perf|
|000018a0| 6f 72 6d 20 61 6c 6c 6f | 63 61 74 69 6f 6e 20 6f |orm allo|cation o|
|000018b0| 66 20 70 73 65 75 64 6f | 2d 72 65 67 69 73 74 65 |f pseudo|-registe|
|000018c0| 72 73 20 6e 6f 74 20 61 | 6c 6c 6f 63 61 74 65 64 |rs not a|llocated|
|000018d0| 20 62 79 20 6c 6f 63 61 | 6c 5f 61 6c 6c 6f 63 2e | by loca|l_alloc.|
|000018e0| 0d 20 20 20 46 49 4c 45 | 20 69 73 20 61 20 66 69 |. FILE| is a fi|
|000018f0| 6c 65 20 74 6f 20 6f 75 | 74 70 75 74 20 64 65 62 |le to ou|tput deb|
|00001900| 75 67 67 69 6e 67 20 69 | 6e 66 6f 72 6d 61 74 69 |ugging i|nformati|
|00001910| 6f 6e 20 6f 6e 2c 0d 20 | 20 20 6f 72 20 7a 65 72 |on on,. | or zer|
|00001920| 6f 20 69 66 20 73 75 63 | 68 20 6f 75 74 70 75 74 |o if suc|h output|
|00001930| 20 69 73 20 6e 6f 74 20 | 64 65 73 69 72 65 64 2e | is not |desired.|
|00001940| 20 20 2a 2f 0d 0d 76 6f | 69 64 0d 67 6c 6f 62 61 | */..vo|id.globa|
|00001950| 6c 5f 61 6c 6c 6f 63 20 | 28 66 69 6c 65 29 0d 20 |l_alloc |(file). |
|00001960| 20 20 20 20 46 49 4c 45 | 20 2a 66 69 6c 65 3b 0d | FILE| *file;.|
|00001970| 7b 0d 20 20 72 65 67 69 | 73 74 65 72 20 69 6e 74 |{. regi|ster int|
|00001980| 20 69 3b 0d 0d 20 20 6d | 61 78 5f 61 6c 6c 6f 63 | i;.. m|ax_alloc|
|00001990| 6e 6f 20 3d 20 30 3b 0d | 0d 20 20 43 4c 45 41 52 |no = 0;.|. CLEAR|
|000019a0| 5f 48 41 52 44 5f 52 45 | 47 5f 53 45 54 20 28 72 |_HARD_RE|G_SET (r|
|000019b0| 65 67 73 5f 73 6f 6d 65 | 6f 6e 65 5f 70 72 65 66 |egs_some|one_pref|
|000019c0| 65 72 73 29 3b 0d 0d 20 | 20 2f 2a 20 41 20 6d 61 |ers);.. | /* A ma|
|000019d0| 63 68 69 6e 65 20 6d 61 | 79 20 68 61 76 65 20 63 |chine ma|y have c|
|000019e0| 65 72 74 61 69 6e 20 68 | 61 72 64 20 72 65 67 69 |ertain h|ard regi|
|000019f0| 73 74 65 72 73 20 74 68 | 61 74 0d 20 20 20 20 20 |sters th|at. |
|00001a00| 61 72 65 20 73 61 66 65 | 20 74 6f 20 75 73 65 20 |are safe| to use |
|00001a10| 6f 6e 6c 79 20 77 69 74 | 68 69 6e 20 61 20 62 61 |only wit|hin a ba|
|00001a20| 73 69 63 20 62 6c 6f 63 | 6b 2e 20 20 2a 2f 0d 0d |sic bloc|k. */..|
|00001a30| 20 20 43 4c 45 41 52 5f | 48 41 52 44 5f 52 45 47 | CLEAR_|HARD_REG|
|00001a40| 5f 53 45 54 20 28 6e 6f | 5f 67 6c 6f 62 61 6c 5f |_SET (no|_global_|
|00001a50| 61 6c 6c 6f 63 5f 72 65 | 67 73 29 3b 0d 23 69 66 |alloc_re|gs);.#if|
|00001a60| 64 65 66 20 4f 56 45 52 | 4c 41 50 50 49 4e 47 5f |def OVER|LAPPING_|
|00001a70| 52 45 47 4e 4f 5f 50 0d | 20 20 66 6f 72 20 28 69 |REGNO_P.| for (i|
|00001a80| 20 3d 20 30 3b 20 69 20 | 3c 20 46 49 52 53 54 5f | = 0; i |< FIRST_|
|00001a90| 50 53 45 55 44 4f 5f 52 | 45 47 49 53 54 45 52 3b |PSEUDO_R|EGISTER;|
|00001aa0| 20 69 2b 2b 29 0d 20 20 | 20 20 69 66 20 28 4f 56 | i++). | if (OV|
|00001ab0| 45 52 4c 41 50 50 49 4e | 47 5f 52 45 47 4e 4f 5f |ERLAPPIN|G_REGNO_|
|00001ac0| 50 20 28 69 29 29 0d 20 | 20 20 20 20 20 53 45 54 |P (i)). | SET|
|00001ad0| 5f 48 41 52 44 5f 52 45 | 47 5f 42 49 54 20 28 6e |_HARD_RE|G_BIT (n|
|00001ae0| 6f 5f 67 6c 6f 62 61 6c | 5f 61 6c 6c 6f 63 5f 72 |o_global|_alloc_r|
|00001af0| 65 67 73 2c 20 69 29 3b | 0d 23 65 6e 64 69 66 0d |egs, i);|.#endif.|
|00001b00| 0d 20 20 2f 2a 20 45 73 | 74 61 62 6c 69 73 68 20 |. /* Es|tablish |
|00001b10| 6d 61 70 70 69 6e 67 73 | 20 66 72 6f 6d 20 72 65 |mappings| from re|
|00001b20| 67 69 73 74 65 72 20 6e | 75 6d 62 65 72 20 74 6f |gister n|umber to|
|00001b30| 20 61 6c 6c 6f 63 61 74 | 69 6f 6e 20 6e 75 6d 62 | allocat|ion numb|
|00001b40| 65 72 0d 20 20 20 20 20 | 61 6e 64 20 76 69 63 65 |er. |and vice|
|00001b50| 20 76 65 72 73 61 2e 20 | 20 49 6e 20 74 68 65 20 | versa. | In the |
|00001b60| 70 72 6f 63 65 73 73 2c | 20 63 6f 75 6e 74 20 74 |process,| count t|
|00001b70| 68 65 20 61 6c 6c 6f 63 | 6e 6f 73 2e 20 20 2a 2f |he alloc|nos. */|
|00001b80| 0d 0d 20 20 72 65 67 5f | 61 6c 6c 6f 63 6e 6f 20 |.. reg_|allocno |
|00001b90| 3d 20 28 69 6e 74 20 2a | 29 20 61 6c 6c 6f 63 61 |= (int *|) alloca|
|00001ba0| 20 28 6d 61 78 5f 72 65 | 67 6e 6f 20 2a 20 73 69 | (max_re|gno * si|
|00001bb0| 7a 65 6f 66 20 28 69 6e | 74 29 29 3b 0d 0d 20 20 |zeof (in|t));.. |
|00001bc0| 66 6f 72 20 28 69 20 3d | 20 30 3b 20 69 20 3c 20 |for (i =| 0; i < |
|00001bd0| 46 49 52 53 54 5f 50 53 | 45 55 44 4f 5f 52 45 47 |FIRST_PS|EUDO_REG|
|00001be0| 49 53 54 45 52 3b 20 69 | 2b 2b 29 0d 20 20 20 20 |ISTER; i|++). |
|00001bf0| 72 65 67 5f 61 6c 6c 6f | 63 6e 6f 5b 69 5d 20 3d |reg_allo|cno[i] =|
|00001c00| 20 2d 31 3b 0d 0d 20 20 | 66 6f 72 20 28 69 20 3d | -1;.. |for (i =|
|00001c10| 20 46 49 52 53 54 5f 50 | 53 45 55 44 4f 5f 52 45 | FIRST_P|SEUDO_RE|
|00001c20| 47 49 53 54 45 52 3b 20 | 69 20 3c 20 6d 61 78 5f |GISTER; |i < max_|
|00001c30| 72 65 67 6e 6f 3b 20 69 | 2b 2b 29 0d 20 20 20 20 |regno; i|++). |
|00001c40| 2f 2a 20 4e 6f 74 65 20 | 74 68 61 74 20 72 65 67 |/* Note |that reg|
|00001c50| 5f 6c 69 76 65 5f 6c 65 | 6e 67 74 68 5b 69 5d 20 |_live_le|ngth[i] |
|00001c60| 3c 20 30 20 69 6e 64 69 | 63 61 74 65 73 20 61 20 |< 0 indi|cates a |
|00001c70| 22 63 6f 6e 73 74 61 6e | 74 22 20 72 65 67 0d 20 |"constan|t" reg. |
|00001c80| 20 20 20 20 20 20 74 68 | 61 74 20 77 65 20 61 72 | th|at we ar|
|00001c90| 65 20 73 75 70 70 6f 73 | 65 64 20 74 6f 20 72 65 |e suppos|ed to re|
|00001ca0| 66 72 61 69 6e 20 66 72 | 6f 6d 20 70 75 74 74 69 |frain fr|om putti|
|00001cb0| 6e 67 20 69 6e 20 61 20 | 68 61 72 64 20 72 65 67 |ng in a |hard reg|
|00001cc0| 2e 0d 20 20 20 20 20 20 | 20 2d 32 20 6d 65 61 6e |.. | -2 mean|
|00001cd0| 73 20 64 6f 20 6d 61 6b | 65 20 61 6e 20 61 6c 6c |s do mak|e an all|
|00001ce0| 6f 63 6e 6f 20 62 75 74 | 20 64 6f 6e 27 74 20 61 |ocno but| don't a|
|00001cf0| 6c 6c 6f 63 61 74 65 20 | 69 74 2e 20 20 2a 2f 0d |llocate |it. */.|
|00001d00| 20 20 20 20 69 66 20 28 | 72 65 67 5f 6e 5f 72 65 | if (|reg_n_re|
|00001d10| 66 73 5b 69 5d 20 21 3d | 20 30 20 26 26 20 72 65 |fs[i] !=| 0 && re|
|00001d20| 67 5f 72 65 6e 75 6d 62 | 65 72 5b 69 5d 20 3c 20 |g_renumb|er[i] < |
|00001d30| 30 20 26 26 20 72 65 67 | 5f 6c 69 76 65 5f 6c 65 |0 && reg|_live_le|
|00001d40| 6e 67 74 68 5b 69 5d 20 | 21 3d 20 2d 31 29 0d 20 |ngth[i] |!= -1). |
|00001d50| 20 20 20 20 20 7b 0d 09 | 72 65 67 5f 61 6c 6c 6f | {..|reg_allo|
|00001d60| 63 6e 6f 5b 69 5d 20 3d | 20 6d 61 78 5f 61 6c 6c |cno[i] =| max_all|
|00001d70| 6f 63 6e 6f 2b 2b 3b 0d | 09 69 66 20 28 72 65 67 |ocno++;.|.if (reg|
|00001d80| 5f 6c 69 76 65 5f 6c 65 | 6e 67 74 68 5b 69 5d 20 |_live_le|ngth[i] |
|00001d90| 3d 3d 20 30 29 0d 09 20 | 20 61 62 6f 72 74 20 28 |== 0).. | abort (|
|00001da0| 29 3b 0d 20 20 20 20 20 | 20 7d 0d 20 20 20 20 65 |);. | }. e|
|00001db0| 6c 73 65 0d 20 20 20 20 | 20 20 72 65 67 5f 61 6c |lse. | reg_al|
|00001dc0| 6c 6f 63 6e 6f 5b 69 5d | 20 3d 20 2d 31 3b 0d 0d |locno[i]| = -1;..|
|00001dd0| 20 20 61 6c 6c 6f 63 6e | 6f 5f 72 65 67 20 3d 20 | allocn|o_reg = |
|00001de0| 28 69 6e 74 20 2a 29 20 | 61 6c 6c 6f 63 61 20 28 |(int *) |alloca (|
|00001df0| 6d 61 78 5f 61 6c 6c 6f | 63 6e 6f 20 2a 20 73 69 |max_allo|cno * si|
|00001e00| 7a 65 6f 66 20 28 69 6e | 74 29 29 3b 0d 20 20 61 |zeof (in|t));. a|
|00001e10| 6c 6c 6f 63 6e 6f 5f 73 | 69 7a 65 20 3d 20 28 69 |llocno_s|ize = (i|
|00001e20| 6e 74 20 2a 29 20 61 6c | 6c 6f 63 61 20 28 6d 61 |nt *) al|loca (ma|
|00001e30| 78 5f 61 6c 6c 6f 63 6e | 6f 20 2a 20 73 69 7a 65 |x_allocn|o * size|
|00001e40| 6f 66 20 28 69 6e 74 29 | 29 3b 0d 20 20 62 7a 65 |of (int)|);. bze|
|00001e50| 72 6f 20 28 61 6c 6c 6f | 63 6e 6f 5f 73 69 7a 65 |ro (allo|cno_size|
|00001e60| 2c 20 6d 61 78 5f 61 6c | 6c 6f 63 6e 6f 20 2a 20 |, max_al|locno * |
|00001e70| 73 69 7a 65 6f 66 20 28 | 69 6e 74 29 29 3b 0d 0d |sizeof (|int));..|
|00001e80| 20 20 66 6f 72 20 28 69 | 20 3d 20 46 49 52 53 54 | for (i| = FIRST|
|00001e90| 5f 50 53 45 55 44 4f 5f | 52 45 47 49 53 54 45 52 |_PSEUDO_|REGISTER|
|00001ea0| 3b 20 69 20 3c 20 6d 61 | 78 5f 72 65 67 6e 6f 3b |; i < ma|x_regno;|
|00001eb0| 20 69 2b 2b 29 0d 20 20 | 20 20 7b 0d 0d 23 69 66 | i++). | {..#if|
|00001ec0| 64 65 66 20 4d 50 57 0d | 20 20 20 20 53 70 69 6e |def MPW.| Spin|
|00001ed0| 43 75 72 73 6f 72 28 31 | 29 3b 0d 23 65 6e 64 69 |Cursor(1|);.#endi|
|00001ee0| 66 0d 0d 20 20 20 20 69 | 66 20 28 72 65 67 5f 61 |f.. i|f (reg_a|
|00001ef0| 6c 6c 6f 63 6e 6f 5b 69 | 5d 20 3e 3d 20 30 29 0d |llocno[i|] >= 0).|
|00001f00| 20 20 20 20 20 20 7b 0d | 09 61 6c 6c 6f 63 6e 6f | {.|.allocno|
|00001f10| 5f 72 65 67 5b 72 65 67 | 5f 61 6c 6c 6f 63 6e 6f |_reg[reg|_allocno|
|00001f20| 5b 69 5d 5d 20 3d 20 69 | 3b 0d 09 61 6c 6c 6f 63 |[i]] = i|;..alloc|
|00001f30| 6e 6f 5f 73 69 7a 65 5b | 72 65 67 5f 61 6c 6c 6f |no_size[|reg_allo|
|00001f40| 63 6e 6f 5b 69 5d 5d 20 | 3d 20 50 53 45 55 44 4f |cno[i]] |= PSEUDO|
|00001f50| 5f 52 45 47 4e 4f 5f 53 | 49 5a 45 20 28 69 29 3b |_REGNO_S|IZE (i);|
|00001f60| 0d 20 20 20 20 20 20 7d | 0d 09 7d 0d 0d 20 20 2f |. }|..}.. /|
|00001f70| 2a 20 41 6c 6c 6f 63 61 | 74 65 20 74 68 65 20 73 |* Alloca|te the s|
|00001f80| 70 61 63 65 20 66 6f 72 | 20 74 68 65 20 63 6f 6e |pace for| the con|
|00001f90| 66 6c 69 63 74 20 74 61 | 62 6c 65 73 2e 20 20 2a |flict ta|bles. *|
|00001fa0| 2f 0d 0d 20 20 68 61 72 | 64 5f 72 65 67 5f 63 6f |/.. har|d_reg_co|
|00001fb0| 6e 66 6c 69 63 74 73 20 | 3d 20 28 48 41 52 44 5f |nflicts |= (HARD_|
|00001fc0| 52 45 47 5f 53 45 54 20 | 2a 29 0d 20 20 20 20 61 |REG_SET |*). a|
|00001fd0| 6c 6c 6f 63 61 20 28 6d | 61 78 5f 61 6c 6c 6f 63 |lloca (m|ax_alloc|
|00001fe0| 6e 6f 20 2a 20 73 69 7a | 65 6f 66 20 28 48 41 52 |no * siz|eof (HAR|
|00001ff0| 44 5f 52 45 47 5f 53 45 | 54 29 29 3b 0d 20 20 62 |D_REG_SE|T));. b|
|00002000| 7a 65 72 6f 20 28 68 61 | 72 64 5f 72 65 67 5f 63 |zero (ha|rd_reg_c|
|00002010| 6f 6e 66 6c 69 63 74 73 | 2c 20 6d 61 78 5f 61 6c |onflicts|, max_al|
|00002020| 6c 6f 63 6e 6f 20 2a 20 | 73 69 7a 65 6f 66 20 28 |locno * |sizeof (|
|00002030| 48 41 52 44 5f 52 45 47 | 5f 53 45 54 29 29 3b 0d |HARD_REG|_SET));.|
|00002040| 0d 20 20 68 61 72 64 5f | 72 65 67 5f 70 72 65 66 |. hard_|reg_pref|
|00002050| 65 72 65 6e 63 65 73 20 | 3d 20 28 48 41 52 44 5f |erences |= (HARD_|
|00002060| 52 45 47 5f 53 45 54 20 | 2a 29 0d 20 20 20 20 61 |REG_SET |*). a|
|00002070| 6c 6c 6f 63 61 20 28 6d | 61 78 5f 61 6c 6c 6f 63 |lloca (m|ax_alloc|
|00002080| 6e 6f 20 2a 20 73 69 7a | 65 6f 66 20 28 48 41 52 |no * siz|eof (HAR|
|00002090| 44 5f 52 45 47 5f 53 45 | 54 29 29 3b 0d 20 20 62 |D_REG_SE|T));. b|
|000020a0| 7a 65 72 6f 20 28 68 61 | 72 64 5f 72 65 67 5f 70 |zero (ha|rd_reg_p|
|000020b0| 72 65 66 65 72 65 6e 63 | 65 73 2c 20 6d 61 78 5f |referenc|es, max_|
|000020c0| 61 6c 6c 6f 63 6e 6f 20 | 2a 20 73 69 7a 65 6f 66 |allocno |* sizeof|
|000020d0| 20 28 48 41 52 44 5f 52 | 45 47 5f 53 45 54 29 29 | (HARD_R|EG_SET))|
|000020e0| 3b 0d 0d 20 20 61 6c 6c | 6f 63 6e 6f 5f 72 6f 77 |;.. all|ocno_row|
|000020f0| 5f 77 6f 72 64 73 20 3d | 20 28 6d 61 78 5f 61 6c |_words =| (max_al|
|00002100| 6c 6f 63 6e 6f 20 2b 20 | 49 4e 54 5f 42 49 54 53 |locno + |INT_BITS|
|00002110| 20 2d 20 31 29 20 2f 20 | 49 4e 54 5f 42 49 54 53 | - 1) / |INT_BITS|
|00002120| 3b 0d 0d 20 20 63 6f 6e | 66 6c 69 63 74 73 20 3d |;.. con|flicts =|
|00002130| 20 28 69 6e 74 20 2a 29 | 0d 20 20 20 20 61 6c 6c | (int *)|. all|
|00002140| 6f 63 61 20 28 6d 61 78 | 5f 61 6c 6c 6f 63 6e 6f |oca (max|_allocno|
|00002150| 20 2a 20 61 6c 6c 6f 63 | 6e 6f 5f 72 6f 77 5f 77 | * alloc|no_row_w|
|00002160| 6f 72 64 73 20 2a 20 73 | 69 7a 65 6f 66 20 28 69 |ords * s|izeof (i|
|00002170| 6e 74 29 29 3b 0d 20 20 | 62 7a 65 72 6f 20 28 63 |nt));. |bzero (c|
|00002180| 6f 6e 66 6c 69 63 74 73 | 2c 20 6d 61 78 5f 61 6c |onflicts|, max_al|
|00002190| 6c 6f 63 6e 6f 20 2a 20 | 61 6c 6c 6f 63 6e 6f 5f |locno * |allocno_|
|000021a0| 72 6f 77 5f 77 6f 72 64 | 73 20 2a 20 73 69 7a 65 |row_word|s * size|
|000021b0| 6f 66 20 28 69 6e 74 29 | 29 3b 0d 0d 20 20 61 6c |of (int)|);.. al|
|000021c0| 6c 6f 63 6e 6f 73 5f 6c | 69 76 65 20 3d 20 28 69 |locnos_l|ive = (i|
|000021d0| 6e 74 20 2a 29 20 61 6c | 6c 6f 63 61 20 28 61 6c |nt *) al|loca (al|
|000021e0| 6c 6f 63 6e 6f 5f 72 6f | 77 5f 77 6f 72 64 73 20 |locno_ro|w_words |
|000021f0| 2a 20 73 69 7a 65 6f 66 | 20 28 69 6e 74 29 29 3b |* sizeof| (int));|
|00002200| 0d 0d 20 20 2f 2a 20 49 | 66 20 74 68 65 72 65 20 |.. /* I|f there |
|00002210| 69 73 20 77 6f 72 6b 20 | 74 6f 20 62 65 20 64 6f |is work |to be do|
|00002220| 6e 65 20 28 61 74 20 6c | 65 61 73 74 20 6f 6e 65 |ne (at l|east one|
|00002230| 20 72 65 67 20 74 6f 20 | 61 6c 6c 6f 63 61 74 65 | reg to |allocate|
|00002240| 29 2c 0d 20 20 20 20 20 | 70 65 72 66 6f 72 6d 20 |),. |perform |
|00002250| 67 6c 6f 62 61 6c 20 63 | 6f 6e 66 6c 69 63 74 20 |global c|onflict |
|00002260| 61 6e 61 6c 79 73 69 73 | 20 61 6e 64 20 61 6c 6c |analysis| and all|
|00002270| 6f 63 61 74 65 20 74 68 | 65 20 72 65 67 73 2e 20 |ocate th|e regs. |
|00002280| 20 2a 2f 0d 0d 20 20 69 | 66 20 28 6d 61 78 5f 61 | */.. i|f (max_a|
|00002290| 6c 6c 6f 63 6e 6f 20 3e | 20 30 29 0d 20 20 20 20 |llocno >| 0). |
|000022a0| 7b 0d 20 20 20 20 20 20 | 2f 2a 20 53 63 61 6e 20 |{. |/* Scan |
|000022b0| 61 6c 6c 20 74 68 65 20 | 69 6e 73 6e 73 20 61 6e |all the |insns an|
|000022c0| 64 20 63 6f 6d 70 75 74 | 65 20 74 68 65 20 63 6f |d comput|e the co|
|000022d0| 6e 66 6c 69 63 74 73 20 | 61 6d 6f 6e 67 20 61 6c |nflicts |among al|
|000022e0| 6c 6f 63 6e 6f 73 0d 09 | 20 61 6e 64 20 62 65 74 |locnos..| and bet|
|000022f0| 77 65 65 6e 20 61 6c 6c | 6f 63 6e 6f 73 20 61 6e |ween all|ocnos an|
|00002300| 64 20 68 61 72 64 20 72 | 65 67 73 2e 20 20 2a 2f |d hard r|egs. */|
|00002310| 0d 0d 20 20 20 20 20 20 | 67 6c 6f 62 61 6c 5f 63 |.. |global_c|
|00002320| 6f 6e 66 6c 69 63 74 73 | 20 28 29 3b 0d 0d 20 20 |onflicts| ();.. |
|00002330| 20 20 20 20 2f 2a 20 44 | 65 74 65 72 6d 69 6e 65 | /* D|etermine|
|00002340| 20 74 68 65 20 6f 72 64 | 65 72 20 74 6f 20 61 6c | the ord|er to al|
|00002350| 6c 6f 63 61 74 65 20 74 | 68 65 20 72 65 6d 61 69 |locate t|he remai|
|00002360| 6e 69 6e 67 20 70 73 65 | 75 64 6f 20 72 65 67 69 |ning pse|udo regi|
|00002370| 73 74 65 72 73 2e 20 20 | 2a 2f 0d 0d 20 20 20 20 |sters. |*/.. |
|00002380| 20 20 61 6c 6c 6f 63 6e | 6f 5f 6f 72 64 65 72 20 | allocn|o_order |
|00002390| 3d 20 28 69 6e 74 20 2a | 29 20 61 6c 6c 6f 63 61 |= (int *|) alloca|
|000023a0| 20 28 6d 61 78 5f 61 6c | 6c 6f 63 6e 6f 20 2a 20 | (max_al|locno * |
|000023b0| 73 69 7a 65 6f 66 20 28 | 69 6e 74 29 29 3b 0d 20 |sizeof (|int));. |
|000023c0| 20 20 20 20 20 66 6f 72 | 20 28 69 20 3d 20 30 3b | for| (i = 0;|
|000023d0| 20 69 20 3c 20 6d 61 78 | 5f 61 6c 6c 6f 63 6e 6f | i < max|_allocno|
|000023e0| 3b 20 69 2b 2b 29 0d 09 | 61 6c 6c 6f 63 6e 6f 5f |; i++)..|allocno_|
|000023f0| 6f 72 64 65 72 5b 69 5d | 20 3d 20 69 3b 0d 0d 20 |order[i]| = i;.. |
|00002400| 20 20 20 20 20 2f 2a 20 | 44 65 66 61 75 6c 74 20 | /* |Default |
|00002410| 74 68 65 20 73 69 7a 65 | 20 74 6f 20 31 2c 20 73 |the size| to 1, s|
|00002420| 69 6e 63 65 20 61 6c 6c | 6f 63 6e 6f 5f 63 6f 6d |ince all|ocno_com|
|00002430| 70 61 72 65 20 75 73 65 | 73 20 69 74 20 74 6f 20 |pare use|s it to |
|00002440| 64 69 76 69 64 65 20 62 | 79 2e 20 20 2a 2f 0d 0d |divide b|y. */..|
|00002450| 20 20 20 20 20 20 66 6f | 72 20 28 69 20 3d 20 30 | fo|r (i = 0|
|00002460| 3b 20 69 20 3c 20 6d 61 | 78 5f 61 6c 6c 6f 63 6e |; i < ma|x_allocn|
|00002470| 6f 3b 20 69 2b 2b 29 0d | 09 69 66 20 28 61 6c 6c |o; i++).|.if (all|
|00002480| 6f 63 6e 6f 5f 73 69 7a | 65 5b 69 5d 20 3d 3d 20 |ocno_siz|e[i] == |
|00002490| 30 29 0d 09 20 20 61 6c | 6c 6f 63 6e 6f 5f 73 69 |0).. al|locno_si|
|000024a0| 7a 65 5b 69 5d 20 3d 20 | 31 3b 0d 0d 20 20 20 20 |ze[i] = |1;.. |
|000024b0| 20 20 71 73 6f 72 74 20 | 28 61 6c 6c 6f 63 6e 6f | qsort |(allocno|
|000024c0| 5f 6f 72 64 65 72 2c 20 | 6d 61 78 5f 61 6c 6c 6f |_order, |max_allo|
|000024d0| 63 6e 6f 2c 20 73 69 7a | 65 6f 66 20 28 69 6e 74 |cno, siz|eof (int|
|000024e0| 29 2c 20 61 6c 6c 6f 63 | 6e 6f 5f 63 6f 6d 70 61 |), alloc|no_compa|
|000024f0| 72 65 29 3b 0d 0d 20 20 | 20 20 20 20 69 66 20 28 |re);.. | if (|
|00002500| 66 69 6c 65 29 0d 09 64 | 75 6d 70 5f 63 6f 6e 66 |file)..d|ump_conf|
|00002510| 6c 69 63 74 73 20 28 66 | 69 6c 65 29 3b 0d 0d 20 |licts (f|ile);.. |
|00002520| 20 20 20 20 20 2f 2a 20 | 54 72 79 20 61 6c 6c 6f | /* |Try allo|
|00002530| 63 61 74 69 6e 67 20 74 | 68 65 6d 2c 20 6f 6e 65 |cating t|hem, one|
|00002540| 20 62 79 20 6f 6e 65 2c | 20 69 6e 20 74 68 61 74 | by one,| in that|
|00002550| 20 6f 72 64 65 72 2c 0d | 09 20 65 78 63 65 70 74 | order,.|. except|
|00002560| 20 66 6f 72 20 70 61 72 | 61 6d 65 74 65 72 73 20 | for par|ameters |
|00002570| 6d 61 72 6b 65 64 20 77 | 69 74 68 20 72 65 67 5f |marked w|ith reg_|
|00002580| 6c 69 76 65 5f 6c 65 6e | 67 74 68 5b 72 65 67 6e |live_len|gth[regn|
|00002590| 6f 5d 20 3d 3d 20 2d 32 | 2e 20 20 2a 2f 0d 0d 20 |o] == -2|. */.. |
|000025a0| 20 20 20 20 20 66 6f 72 | 20 28 69 20 3d 20 30 3b | for| (i = 0;|
|000025b0| 20 69 20 3c 20 6d 61 78 | 5f 61 6c 6c 6f 63 6e 6f | i < max|_allocno|
|000025c0| 3b 20 69 2b 2b 29 0d 23 | 69 66 64 65 66 20 4d 50 |; i++).#|ifdef MP|
|000025d0| 57 5f 43 0d 09 69 66 20 | 28 72 65 67 5f 6c 69 76 |W_C..if |(reg_liv|
|000025e0| 65 5f 6c 65 6e 67 74 68 | 5b 61 6c 6c 6f 63 6e 6f |e_length|[allocno|
|000025f0| 5f 72 65 67 5b 2a 28 61 | 6c 6c 6f 63 6e 6f 5f 6f |_reg[*(a|llocno_o|
|00002600| 72 64 65 72 2b 69 29 5d | 5d 20 3e 3d 20 30 29 0d |rder+i)]|] >= 0).|
|00002610| 23 65 6c 73 65 0d 09 69 | 66 20 28 72 65 67 5f 6c |#else..i|f (reg_l|
|00002620| 69 76 65 5f 6c 65 6e 67 | 74 68 5b 61 6c 6c 6f 63 |ive_leng|th[alloc|
|00002630| 6e 6f 5f 72 65 67 5b 61 | 6c 6c 6f 63 6e 6f 5f 6f |no_reg[a|llocno_o|
|00002640| 72 64 65 72 5b 69 5d 5d | 5d 20 3e 3d 20 30 29 0d |rder[i]]|] >= 0).|
|00002650| 23 65 6e 64 69 66 20 2f | 2a 20 4d 50 57 5f 43 20 |#endif /|* MPW_C |
|00002660| 2a 2f 0d 09 20 20 7b 0d | 0d 23 69 66 64 65 66 20 |*/.. {.|.#ifdef |
|00002670| 4d 50 57 0d 20 20 20 20 | 20 20 20 20 53 70 69 6e |MPW. | Spin|
|00002680| 43 75 72 73 6f 72 28 31 | 29 3b 0d 23 65 6e 64 69 |Cursor(1|);.#endi|
|00002690| 66 0d 0d 09 20 20 20 20 | 2f 2a 20 49 66 20 77 65 |f... |/* If we|
|000026a0| 20 68 61 76 65 20 6d 6f | 72 65 20 74 68 61 6e 20 | have mo|re than |
|000026b0| 6f 6e 65 20 72 65 67 69 | 73 74 65 72 20 63 6c 61 |one regi|ster cla|
|000026c0| 73 73 2c 0d 09 20 20 20 | 20 20 20 20 66 69 72 73 |ss,.. | firs|
|000026d0| 74 20 74 72 79 20 61 6c | 6c 6f 63 61 74 69 6e 67 |t try al|locating|
|000026e0| 20 69 6e 20 74 68 65 20 | 63 6c 61 73 73 20 74 68 | in the |class th|
|000026f0| 61 74 20 69 73 20 63 68 | 65 61 70 65 73 74 0d 09 |at is ch|eapest..|
|00002700| 20 20 20 20 20 20 20 66 | 6f 72 20 74 68 69 73 20 | f|or this |
|00002710| 70 73 65 75 64 6f 2d 72 | 65 67 2e 20 20 49 66 20 |pseudo-r|eg. If |
|00002720| 74 68 61 74 20 66 61 69 | 6c 73 2c 20 74 72 79 20 |that fai|ls, try |
|00002730| 61 6e 79 20 72 65 67 2e | 20 20 2a 2f 0d 09 20 20 |any reg.| */.. |
|00002740| 20 20 69 66 20 28 4e 5f | 52 45 47 5f 43 4c 41 53 | if (N_|REG_CLAS|
|00002750| 53 45 53 20 3e 20 31 29 | 0d 09 20 20 20 20 20 20 |SES > 1)|.. |
|00002760| 7b 0d 09 09 66 69 6e 64 | 5f 72 65 67 20 28 61 6c |{...find|_reg (al|
|00002770| 6c 6f 63 6e 6f 5f 6f 72 | 64 65 72 5b 69 5d 2c 20 |locno_or|der[i], |
|00002780| 30 2c 20 30 2c 20 30 2c | 0d 09 09 09 20 20 68 61 |0, 0, 0,|.... ha|
|00002790| 72 64 5f 72 65 67 5f 70 | 72 65 66 65 72 65 6e 63 |rd_reg_p|referenc|
|000027a0| 65 73 5b 61 6c 6c 6f 63 | 6e 6f 5f 6f 72 64 65 72 |es[alloc|no_order|
|000027b0| 5b 69 5d 5d 29 3b 0d 23 | 69 66 64 65 66 20 4d 50 |[i]]);.#|ifdef MP|
|000027c0| 57 5f 43 0d 09 09 69 66 | 20 28 72 65 67 5f 72 65 |W_C...if| (reg_re|
|000027d0| 6e 75 6d 62 65 72 5b 61 | 6c 6c 6f 63 6e 6f 5f 72 |number[a|llocno_r|
|000027e0| 65 67 5b 2a 28 61 6c 6c | 6f 63 6e 6f 5f 6f 72 64 |eg[*(all|ocno_ord|
|000027f0| 65 72 2b 69 29 5d 5d 20 | 3e 3d 20 30 29 0d 23 65 |er+i)]] |>= 0).#e|
|00002800| 6c 73 65 0d 09 09 69 66 | 20 28 72 65 67 5f 72 65 |lse...if| (reg_re|
|00002810| 6e 75 6d 62 65 72 5b 61 | 6c 6c 6f 63 6e 6f 5f 72 |number[a|llocno_r|
|00002820| 65 67 5b 61 6c 6c 6f 63 | 6e 6f 5f 6f 72 64 65 72 |eg[alloc|no_order|
|00002830| 5b 69 5d 5d 5d 20 3e 3d | 20 30 29 0d 23 65 6e 64 |[i]]] >=| 0).#end|
|00002840| 69 66 20 2f 2a 20 4d 50 | 57 5f 43 20 2a 2f 0d 09 |if /* MP|W_C */..|
|00002850| 09 20 20 63 6f 6e 74 69 | 6e 75 65 3b 0d 09 20 20 |. conti|nue;.. |
|00002860| 20 20 20 20 7d 0d 09 20 | 20 20 20 69 66 20 28 21 | }.. | if (!|
|00002870| 72 65 67 5f 70 72 65 66 | 65 72 72 65 64 5f 6f 72 |reg_pref|erred_or|
|00002880| 5f 6e 6f 74 68 69 6e 67 | 20 28 61 6c 6c 6f 63 6e |_nothing| (allocn|
|00002890| 6f 5f 72 65 67 5b 61 6c | 6c 6f 63 6e 6f 5f 6f 72 |o_reg[al|locno_or|
|000028a0| 64 65 72 5b 69 5d 5d 29 | 29 0d 09 20 20 20 20 20 |der[i]])|).. |
|000028b0| 20 66 69 6e 64 5f 72 65 | 67 20 28 61 6c 6c 6f 63 | find_re|g (alloc|
|000028c0| 6e 6f 5f 6f 72 64 65 72 | 5b 69 5d 2c 20 30 2c 20 |no_order|[i], 0, |
|000028d0| 31 2c 20 30 2c 0d 09 09 | 09 68 61 72 64 5f 72 65 |1, 0,...|.hard_re|
|000028e0| 67 5f 70 72 65 66 65 72 | 65 6e 63 65 73 5b 61 6c |g_prefer|ences[al|
|000028f0| 6c 6f 63 6e 6f 5f 6f 72 | 64 65 72 5b 69 5d 5d 29 |locno_or|der[i]])|
|00002900| 3b 0d 09 20 20 7d 0d 20 | 20 20 20 7d 0d 0d 20 20 |;.. }. | }.. |
|00002910| 2f 2a 20 44 6f 20 74 68 | 65 20 72 65 6c 6f 61 64 |/* Do th|e reload|
|00002920| 73 20 6e 6f 77 20 77 68 | 69 6c 65 20 74 68 65 20 |s now wh|ile the |
|00002930| 61 6c 6c 6f 63 6e 6f 20 | 64 61 74 61 20 73 74 69 |allocno |data sti|
|00002940| 6c 6c 20 65 78 69 73 74 | 2c 20 73 6f 20 74 68 61 |ll exist|, so tha|
|00002950| 74 20 77 65 20 63 61 6e | 0d 20 20 20 20 20 74 72 |t we can|. tr|
|00002960| 79 20 74 6f 20 61 73 73 | 69 67 6e 20 6e 65 77 20 |y to ass|ign new |
|00002970| 68 61 72 64 20 72 65 67 | 73 20 74 6f 20 61 6e 79 |hard reg|s to any|
|00002980| 20 70 73 65 75 64 6f 20 | 72 65 67 73 20 74 68 61 | pseudo |regs tha|
|00002990| 74 20 61 72 65 20 73 70 | 69 6c 6c 65 64 2e 20 20 |t are sp|illed. |
|000029a0| 2a 2f 0d 0d 20 20 69 66 | 20 28 6e 5f 62 61 73 69 |*/.. if| (n_basi|
|000029b0| 63 5f 62 6c 6f 63 6b 73 | 20 3e 20 30 29 0d 20 20 |c_blocks| > 0). |
|000029c0| 20 20 72 65 6c 6f 61 64 | 20 28 62 61 73 69 63 5f | reload| (basic_|
|000029d0| 62 6c 6f 63 6b 5f 68 65 | 61 64 5b 30 5d 2c 20 31 |block_he|ad[0], 1|
|000029e0| 2c 20 66 69 6c 65 29 3b | 0d 7d 0d 0d 2f 2a 20 53 |, file);|.}../* S|
|000029f0| 6f 72 74 20 70 72 65 64 | 69 63 61 74 65 20 66 6f |ort pred|icate fo|
|00002a00| 72 20 6f 72 64 65 72 69 | 6e 67 20 74 68 65 20 61 |r orderi|ng the a|
|00002a10| 6c 6c 6f 63 6e 6f 73 2e | 0d 20 20 20 52 65 74 75 |llocnos.|. Retu|
|00002a20| 72 6e 73 20 2d 31 20 28 | 31 29 20 69 66 20 2a 76 |rns -1 (|1) if *v|
|00002a30| 31 20 73 68 6f 75 6c 64 | 20 62 65 20 61 6c 6c 6f |1 should| be allo|
|00002a40| 63 61 74 65 64 20 62 65 | 66 6f 72 65 20 28 61 66 |cated be|fore (af|
|00002a50| 74 65 72 29 20 2a 76 32 | 2e 20 20 2a 2f 0d 0d 73 |ter) *v2|. */..s|
|00002a60| 74 61 74 69 63 20 69 6e | 74 0d 61 6c 6c 6f 63 6e |tatic in|t.allocn|
|00002a70| 6f 5f 63 6f 6d 70 61 72 | 65 20 28 76 31 2c 20 76 |o_compar|e (v1, v|
|00002a80| 32 29 0d 20 20 20 20 20 | 69 6e 74 20 2a 76 31 2c |2). |int *v1,|
|00002a90| 20 2a 76 32 3b 0d 7b 0d | 20 20 72 65 67 69 73 74 | *v2;.{.| regist|
|00002aa0| 65 72 20 69 6e 74 20 72 | 31 20 3d 20 61 6c 6c 6f |er int r|1 = allo|
|00002ab0| 63 6e 6f 5f 72 65 67 5b | 2a 76 31 5d 3b 0d 20 20 |cno_reg[|*v1];. |
|00002ac0| 72 65 67 69 73 74 65 72 | 20 69 6e 74 20 72 32 20 |register| int r2 |
|00002ad0| 3d 20 61 6c 6c 6f 63 6e | 6f 5f 72 65 67 5b 2a 76 |= allocn|o_reg[*v|
|00002ae0| 32 5d 3b 0d 20 20 2f 2a | 20 4e 6f 74 65 20 74 68 |2];. /*| Note th|
|00002af0| 61 74 20 74 68 65 20 71 | 75 6f 74 69 65 6e 74 20 |at the q|uotient |
|00002b00| 77 69 6c 6c 20 6e 65 76 | 65 72 20 62 65 20 62 69 |will nev|er be bi|
|00002b10| 67 67 65 72 20 74 68 61 | 6e 0d 20 20 20 20 20 74 |gger tha|n. t|
|00002b20| 68 65 20 76 61 6c 75 65 | 20 6f 66 20 66 6c 6f 6f |he value| of floo|
|00002b30| 72 5f 6c 6f 67 32 20 74 | 69 6d 65 73 20 74 68 65 |r_log2 t|imes the|
|00002b40| 20 6d 61 78 69 6d 75 6d | 20 6e 75 6d 62 65 72 20 | maximum| number |
|00002b50| 6f 66 0d 20 20 20 20 20 | 74 69 6d 65 73 20 61 20 |of. |times a |
|00002b60| 72 65 67 69 73 74 65 72 | 20 63 61 6e 20 6f 63 63 |register| can occ|
|00002b70| 75 72 20 69 6e 20 6f 6e | 65 20 69 6e 73 6e 20 28 |ur in on|e insn (|
|00002b80| 73 75 72 65 6c 79 20 6c | 65 73 73 20 74 68 61 6e |surely l|ess than|
|00002b90| 20 31 30 30 29 2e 0d 20 | 20 20 20 20 4d 75 6c 74 | 100).. | Mult|
|00002ba0| 69 70 6c 79 69 6e 67 20 | 74 68 69 73 20 62 79 20 |iplying |this by |
|00002bb0| 31 30 30 30 30 20 63 61 | 6e 27 74 20 6f 76 65 72 |10000 ca|n't over|
|00002bc0| 66 6c 6f 77 2e 20 20 2a | 2f 0d 20 20 72 65 67 69 |flow. *|/. regi|
|00002bd0| 73 74 65 72 20 69 6e 74 | 20 70 72 69 31 0d 20 20 |ster int| pri1. |
|00002be0| 20 20 3d 20 28 28 28 64 | 6f 75 62 6c 65 29 20 28 | = (((d|ouble) (|
|00002bf0| 66 6c 6f 6f 72 5f 6c 6f | 67 32 20 28 72 65 67 5f |floor_lo|g2 (reg_|
|00002c00| 6e 5f 72 65 66 73 5b 72 | 31 5d 29 20 2a 20 72 65 |n_refs[r|1]) * re|
|00002c10| 67 5f 6e 5f 72 65 66 73 | 5b 72 31 5d 29 0d 09 2f |g_n_refs|[r1])../|
|00002c20| 20 28 72 65 67 5f 6c 69 | 76 65 5f 6c 65 6e 67 74 | (reg_li|ve_lengt|
|00002c30| 68 5b 72 31 5d 20 2a 20 | 61 6c 6c 6f 63 6e 6f 5f |h[r1] * |allocno_|
|00002c40| 73 69 7a 65 5b 2a 76 31 | 5d 29 29 0d 20 20 20 20 |size[*v1|])). |
|00002c50| 20 20 20 2a 20 31 30 30 | 30 30 29 3b 0d 20 20 72 | * 100|00);. r|
|00002c60| 65 67 69 73 74 65 72 20 | 69 6e 74 20 70 72 69 32 |egister |int pri2|
|00002c70| 0d 20 20 20 20 3d 20 28 | 28 28 64 6f 75 62 6c 65 |. = (|((double|
|00002c80| 29 20 28 66 6c 6f 6f 72 | 5f 6c 6f 67 32 20 28 72 |) (floor|_log2 (r|
|00002c90| 65 67 5f 6e 5f 72 65 66 | 73 5b 72 32 5d 29 20 2a |eg_n_ref|s[r2]) *|
|00002ca0| 20 72 65 67 5f 6e 5f 72 | 65 66 73 5b 72 32 5d 29 | reg_n_r|efs[r2])|
|00002cb0| 0d 09 2f 20 28 72 65 67 | 5f 6c 69 76 65 5f 6c 65 |../ (reg|_live_le|
|00002cc0| 6e 67 74 68 5b 72 32 5d | 20 2a 20 61 6c 6c 6f 63 |ngth[r2]| * alloc|
|00002cd0| 6e 6f 5f 73 69 7a 65 5b | 2a 76 32 5d 29 29 0d 20 |no_size[|*v2])). |
|00002ce0| 20 20 20 20 20 20 2a 20 | 31 30 30 30 30 29 3b 0d | * |10000);.|
|00002cf0| 20 20 69 66 20 28 70 72 | 69 32 20 2d 20 70 72 69 | if (pr|i2 - pri|
|00002d00| 31 29 0d 20 20 20 20 72 | 65 74 75 72 6e 20 70 72 |1). r|eturn pr|
|00002d10| 69 32 20 2d 20 70 72 69 | 31 3b 0d 0d 20 20 2f 2a |i2 - pri|1;.. /*|
|00002d20| 20 49 66 20 72 65 67 73 | 20 61 72 65 20 65 71 75 | If regs| are equ|
|00002d30| 61 6c 6c 79 20 67 6f 6f | 64 2c 20 73 6f 72 74 20 |ally goo|d, sort |
|00002d40| 62 79 20 61 6c 6c 6f 63 | 6e 6f 2c 0d 20 20 20 20 |by alloc|no,. |
|00002d50| 20 73 6f 20 74 68 61 74 | 20 74 68 65 20 72 65 73 | so that| the res|
|00002d60| 75 6c 74 73 20 6f 66 20 | 71 73 6f 72 74 20 6c 65 |ults of |qsort le|
|00002d70| 61 76 65 20 6e 6f 74 68 | 69 6e 67 20 74 6f 20 63 |ave noth|ing to c|
|00002d80| 68 61 6e 63 65 2e 20 20 | 2a 2f 0d 20 20 72 65 74 |hance. |*/. ret|
|00002d90| 75 72 6e 20 2a 76 31 20 | 2d 20 2a 76 32 3b 0d 7d |urn *v1 |- *v2;.}|
|00002da0| 0d 0c 0d 2f 2a 20 53 63 | 61 6e 20 74 68 65 20 72 |.../* Sc|an the r|
|00002db0| 74 6c 20 63 6f 64 65 20 | 61 6e 64 20 72 65 63 6f |tl code |and reco|
|00002dc0| 72 64 20 61 6c 6c 20 63 | 6f 6e 66 6c 69 63 74 73 |rd all c|onflicts|
|00002dd0| 20 69 6e 20 74 68 65 20 | 63 6f 6e 66 6c 69 63 74 | in the |conflict|
|00002de0| 20 6d 61 74 72 69 63 65 | 73 2e 20 20 2a 2f 0d 0d | matrice|s. */..|
|00002df0| 73 74 61 74 69 63 20 76 | 6f 69 64 0d 67 6c 6f 62 |static v|oid.glob|
|00002e00| 61 6c 5f 63 6f 6e 66 6c | 69 63 74 73 20 28 29 0d |al_confl|icts ().|
|00002e10| 7b 0d 20 20 72 65 67 69 | 73 74 65 72 20 69 6e 74 |{. regi|ster int|
|00002e20| 20 62 2c 20 69 3b 0d 20 | 20 72 65 67 69 73 74 65 | b, i;. | registe|
|00002e30| 72 20 72 74 78 20 69 6e | 73 6e 3b 0d 20 20 73 68 |r rtx in|sn;. sh|
|00002e40| 6f 72 74 20 2a 62 6c 6f | 63 6b 5f 73 74 61 72 74 |ort *blo|ck_start|
|00002e50| 5f 61 6c 6c 6f 63 6e 6f | 73 3b 0d 0d 20 20 2f 2a |_allocno|s;.. /*|
|00002e60| 20 4d 61 6b 65 20 61 20 | 76 65 63 74 6f 72 20 74 | Make a |vector t|
|00002e70| 68 61 74 20 6d 61 72 6b | 5f 72 65 67 5f 7b 73 74 |hat mark|_reg_{st|
|00002e80| 6f 72 65 2c 63 6c 6f 62 | 62 65 72 7d 20 77 69 6c |ore,clob|ber} wil|
|00002e90| 6c 20 73 74 6f 72 65 20 | 69 6e 2e 20 20 2a 2f 0d |l store |in. */.|
|00002ea0| 20 20 72 65 67 73 5f 73 | 65 74 20 3d 20 28 72 74 | regs_s|et = (rt|
|00002eb0| 78 20 2a 29 20 61 6c 6c | 6f 63 61 20 28 6d 61 78 |x *) all|oca (max|
|00002ec0| 5f 70 61 72 61 6c 6c 65 | 6c 20 2a 20 73 69 7a 65 |_paralle|l * size|
|00002ed0| 6f 66 20 28 72 74 78 29 | 20 2a 20 32 29 3b 0d 0d |of (rtx)| * 2);..|
|00002ee0| 20 20 62 6c 6f 63 6b 5f | 73 74 61 72 74 5f 61 6c | block_|start_al|
|00002ef0| 6c 6f 63 6e 6f 73 20 3d | 20 28 73 68 6f 72 74 20 |locnos =| (short |
|00002f00| 2a 29 20 61 6c 6c 6f 63 | 61 20 28 6d 61 78 5f 61 |*) alloc|a (max_a|
|00002f10| 6c 6c 6f 63 6e 6f 20 2a | 20 73 69 7a 65 6f 66 20 |llocno *| sizeof |
|00002f20| 28 73 68 6f 72 74 29 29 | 3b 0d 0d 20 20 66 6f 72 |(short))|;.. for|
|00002f30| 20 28 62 20 3d 20 30 3b | 20 62 20 3c 20 6e 5f 62 | (b = 0;| b < n_b|
|00002f40| 61 73 69 63 5f 62 6c 6f | 63 6b 73 3b 20 62 2b 2b |asic_blo|cks; b++|
|00002f50| 29 0d 20 20 20 20 7b 0d | 20 20 20 20 20 20 62 7a |). {.| bz|
|00002f60| 65 72 6f 20 28 61 6c 6c | 6f 63 6e 6f 73 5f 6c 69 |ero (all|ocnos_li|
|00002f70| 76 65 2c 20 61 6c 6c 6f | 63 6e 6f 5f 72 6f 77 5f |ve, allo|cno_row_|
|00002f80| 77 6f 72 64 73 20 2a 20 | 73 69 7a 65 6f 66 20 28 |words * |sizeof (|
|00002f90| 69 6e 74 29 29 3b 0d 0d | 20 20 20 20 20 20 2f 2a |int));..| /*|
|00002fa0| 20 49 6e 69 74 69 61 6c | 69 7a 65 20 74 61 62 6c | Initial|ize tabl|
|00002fb0| 65 20 6f 66 20 72 65 67 | 69 73 74 65 72 73 20 63 |e of reg|isters c|
|00002fc0| 75 72 72 65 6e 74 6c 79 | 20 6c 69 76 65 0d 09 20 |urrently| live.. |
|00002fd0| 74 6f 20 74 68 65 20 73 | 74 61 74 65 20 61 74 20 |to the s|tate at |
|00002fe0| 74 68 65 20 62 65 67 69 | 6e 6e 69 6e 67 20 6f 66 |the begi|nning of|
|00002ff0| 20 74 68 69 73 20 62 61 | 73 69 63 20 62 6c 6f 63 | this ba|sic bloc|
|00003000| 6b 2e 0d 09 20 54 68 69 | 73 20 61 6c 73 6f 20 6d |k... Thi|s also m|
|00003010| 61 72 6b 73 20 74 68 65 | 20 63 6f 6e 66 6c 69 63 |arks the| conflic|
|00003020| 74 73 20 61 6d 6f 6e 67 | 20 74 68 65 6d 2e 0d 0d |ts among| them...|
|00003030| 09 20 46 6f 72 20 70 73 | 65 75 64 6f 2d 72 65 67 |. For ps|eudo-reg|
|00003040| 73 2c 20 74 68 65 72 65 | 20 69 73 20 6f 6e 6c 79 |s, there| is only|
|00003050| 20 6f 6e 65 20 62 69 74 | 20 66 6f 72 20 65 61 63 | one bit| for eac|
|00003060| 68 20 6f 6e 65 0d 09 20 | 6e 6f 20 6d 61 74 74 65 |h one.. |no matte|
|00003070| 72 20 68 6f 77 20 6d 61 | 6e 79 20 68 61 72 64 20 |r how ma|ny hard |
|00003080| 72 65 67 73 20 69 74 20 | 6f 63 63 75 70 69 65 73 |regs it |occupies|
|00003090| 2e 0d 09 20 54 68 69 73 | 20 69 73 20 6f 6b 3b 20 |... This| is ok; |
|000030a0| 77 65 20 6b 6e 6f 77 20 | 74 68 65 20 73 69 7a 65 |we know |the size|
|000030b0| 20 66 72 6f 6d 20 50 53 | 45 55 44 4f 5f 52 45 47 | from PS|EUDO_REG|
|000030c0| 4e 4f 5f 53 49 5a 45 2e | 0d 09 20 46 6f 72 20 65 |NO_SIZE.|.. For e|
|000030d0| 78 70 6c 69 63 69 74 20 | 68 61 72 64 20 72 65 67 |xplicit |hard reg|
|000030e0| 73 2c 20 77 65 20 63 61 | 6e 6e 6f 74 20 6b 6e 6f |s, we ca|nnot kno|
|000030f0| 77 20 74 68 65 20 73 69 | 7a 65 20 74 68 61 74 20 |w the si|ze that |
|00003100| 77 61 79 0d 09 20 73 69 | 6e 63 65 20 6f 6e 65 20 |way.. si|nce one |
|00003110| 68 61 72 64 20 72 65 67 | 20 63 61 6e 20 62 65 20 |hard reg| can be |
|00003120| 75 73 65 64 20 77 69 74 | 68 20 76 61 72 69 6f 75 |used wit|h variou|
|00003130| 73 20 73 69 7a 65 73 2e | 0d 09 20 54 68 65 72 65 |s sizes.|.. There|
|00003140| 66 6f 72 65 2c 20 77 65 | 20 6d 75 73 74 20 72 65 |fore, we| must re|
|00003150| 71 75 69 72 65 20 74 68 | 61 74 20 61 6c 6c 20 74 |quire th|at all t|
|00003160| 68 65 20 68 61 72 64 20 | 72 65 67 73 0d 09 20 69 |he hard |regs.. i|
|00003170| 6d 70 6c 69 63 69 74 6c | 79 20 6c 69 76 65 20 61 |mplicitl|y live a|
|00003180| 73 20 70 61 72 74 20 6f | 66 20 61 20 6d 75 6c 74 |s part o|f a mult|
|00003190| 69 2d 77 6f 72 64 20 68 | 61 72 64 20 72 65 67 0d |i-word h|ard reg.|
|000031a0| 09 20 61 72 65 20 65 78 | 70 6c 69 63 69 74 6c 79 |. are ex|plicitly|
|000031b0| 20 6d 61 72 6b 65 64 20 | 69 6e 20 62 61 73 69 63 | marked |in basic|
|000031c0| 5f 62 6c 6f 63 6b 5f 6c | 69 76 65 5f 61 74 5f 73 |_block_l|ive_at_s|
|000031d0| 74 61 72 74 2e 20 20 2a | 2f 0d 0d 20 20 20 20 20 |tart. *|/.. |
|000031e0| 20 7b 0d 09 72 65 67 69 | 73 74 65 72 20 69 6e 74 | {..regi|ster int|
|000031f0| 20 6f 66 66 73 65 74 2c | 20 62 69 74 3b 0d 09 72 | offset,| bit;..r|
|00003200| 65 67 69 73 74 65 72 20 | 72 65 67 73 65 74 20 6f |egister |regset o|
|00003210| 6c 64 20 3d 20 62 61 73 | 69 63 5f 62 6c 6f 63 6b |ld = bas|ic_block|
|00003220| 5f 6c 69 76 65 5f 61 74 | 5f 73 74 61 72 74 5b 62 |_live_at|_start[b|
|00003230| 5d 3b 0d 09 69 6e 74 20 | 61 78 20 3d 20 30 3b 0d |];..int |ax = 0;.|
|00003240| 0d 23 69 66 64 65 66 20 | 48 41 52 44 5f 52 45 47 |.#ifdef |HARD_REG|
|00003250| 5f 53 45 54 0d 09 68 61 | 72 64 5f 72 65 67 73 5f |_SET..ha|rd_regs_|
|00003260| 6c 69 76 65 20 3d 20 6f | 6c 64 5b 30 5d 3b 0d 23 |live = o|ld[0];.#|
|00003270| 65 6c 73 65 0d 09 43 4f | 50 59 5f 48 41 52 44 5f |else..CO|PY_HARD_|
|00003280| 52 45 47 5f 53 45 54 20 | 28 68 61 72 64 5f 72 65 |REG_SET |(hard_re|
|00003290| 67 73 5f 6c 69 76 65 2c | 20 6f 6c 64 29 3b 0d 23 |gs_live,| old);.#|
|000032a0| 65 6e 64 69 66 0d 09 66 | 6f 72 20 28 6f 66 66 73 |endif..f|or (offs|
|000032b0| 65 74 20 3d 20 30 2c 20 | 69 20 3d 20 30 3b 20 6f |et = 0, |i = 0; o|
|000032c0| 66 66 73 65 74 20 3c 20 | 72 65 67 73 65 74 5f 73 |ffset < |regset_s|
|000032d0| 69 7a 65 3b 20 6f 66 66 | 73 65 74 2b 2b 29 0d 09 |ize; off|set++)..|
|000032e0| 20 20 7b 0d 09 20 20 69 | 66 20 28 6f 6c 64 5b 6f | {.. i|f (old[o|
|000032f0| 66 66 73 65 74 5d 20 3d | 3d 20 30 29 0d 09 20 20 |ffset] =|= 0).. |
|00003300| 20 20 69 20 2b 3d 20 48 | 4f 53 54 5f 42 49 54 53 | i += H|OST_BITS|
|00003310| 5f 50 45 52 5f 49 4e 54 | 3b 0d 09 20 20 65 6c 73 |_PER_INT|;.. els|
|00003320| 65 0d 09 20 20 20 20 66 | 6f 72 20 28 62 69 74 20 |e.. f|or (bit |
|00003330| 3d 20 31 3b 20 62 69 74 | 3b 20 62 69 74 20 3c 3c |= 1; bit|; bit <<|
|00003340| 3d 20 31 2c 20 69 2b 2b | 29 0d 09 20 20 20 20 20 |= 1, i++|).. |
|00003350| 20 7b 0d 09 09 69 66 20 | 28 69 20 3e 3d 20 6d 61 | {...if |(i >= ma|
|00003360| 78 5f 72 65 67 6e 6f 29 | 0d 09 09 20 20 62 72 65 |x_regno)|... bre|
|00003370| 61 6b 3b 0d 09 09 69 66 | 20 28 6f 6c 64 5b 6f 66 |ak;...if| (old[of|
|00003380| 66 73 65 74 5d 20 26 20 | 62 69 74 29 0d 09 09 20 |fset] & |bit)... |
|00003390| 20 7b 0d 09 09 20 20 20 | 20 72 65 67 69 73 74 65 | {... | registe|
|000033a0| 72 20 69 6e 74 20 61 20 | 3d 20 72 65 67 5f 61 6c |r int a |= reg_al|
|000033b0| 6c 6f 63 6e 6f 5b 69 5d | 3b 0d 09 09 20 20 20 20 |locno[i]|;... |
|000033c0| 69 66 20 28 61 20 3e 3d | 20 30 29 0d 09 09 20 20 |if (a >=| 0)... |
|000033d0| 20 20 20 20 7b 0d 09 09 | 09 53 45 54 5f 41 4c 4c | {...|.SET_ALL|
|000033e0| 4f 43 4e 4f 5f 4c 49 56 | 45 20 28 61 29 3b 0d 09 |OCNO_LIV|E (a);..|
|000033f0| 09 09 62 6c 6f 63 6b 5f | 73 74 61 72 74 5f 61 6c |..block_|start_al|
|00003400| 6c 6f 63 6e 6f 73 5b 61 | 78 2b 2b 5d 20 3d 20 61 |locnos[a|x++] = a|
|00003410| 3b 0d 09 09 20 20 20 20 | 20 20 7d 0d 09 09 20 20 |;... | }... |
|00003420| 20 20 65 6c 73 65 20 69 | 66 20 28 28 61 20 3d 20 | else i|f ((a = |
|00003430| 72 65 67 5f 72 65 6e 75 | 6d 62 65 72 5b 69 5d 29 |reg_renu|mber[i])|
|00003440| 20 3e 3d 20 30 29 0d 09 | 09 20 20 20 20 20 20 6d | >= 0)..|. m|
|00003450| 61 72 6b 5f 72 65 67 5f | 6c 69 76 65 5f 6e 63 20 |ark_reg_|live_nc |
|00003460| 28 61 2c 20 50 53 45 55 | 44 4f 5f 52 45 47 4e 4f |(a, PSEU|DO_REGNO|
|00003470| 5f 4d 4f 44 45 20 28 69 | 29 29 3b 0d 09 09 20 20 |_MODE (i|));... |
|00003480| 7d 0d 09 20 20 20 20 20 | 20 7d 0d 09 09 20 20 7d |}.. | }... }|
|00003490| 0d 0d 09 2f 2a 20 52 65 | 63 6f 72 64 20 74 68 61 |.../* Re|cord tha|
|000034a0| 74 20 65 61 63 68 20 61 | 6c 6c 6f 63 6e 6f 20 6e |t each a|llocno n|
|000034b0| 6f 77 20 6c 69 76 65 20 | 63 6f 6e 66 6c 69 63 74 |ow live |conflict|
|000034c0| 73 20 77 69 74 68 20 65 | 61 63 68 20 6f 74 68 65 |s with e|ach othe|
|000034d0| 72 0d 09 20 20 20 61 6c | 6c 6f 63 6e 6f 20 6e 6f |r.. al|locno no|
|000034e0| 77 20 6c 69 76 65 2c 20 | 61 6e 64 20 77 69 74 68 |w live, |and with|
|000034f0| 20 65 61 63 68 20 68 61 | 72 64 20 72 65 67 20 6e | each ha|rd reg n|
|00003500| 6f 77 20 6c 69 76 65 2e | 20 20 2a 2f 0d 0d 09 72 |ow live.| */...r|
|00003510| 65 63 6f 72 64 5f 63 6f | 6e 66 6c 69 63 74 73 20 |ecord_co|nflicts |
|00003520| 28 62 6c 6f 63 6b 5f 73 | 74 61 72 74 5f 61 6c 6c |(block_s|tart_all|
|00003530| 6f 63 6e 6f 73 2c 20 61 | 78 29 3b 0d 20 20 20 20 |ocnos, a|x);. |
|00003540| 20 20 7d 0d 0d 20 20 20 | 20 20 20 69 6e 73 6e 20 | }.. | insn |
|00003550| 3d 20 62 61 73 69 63 5f | 62 6c 6f 63 6b 5f 68 65 |= basic_|block_he|
|00003560| 61 64 5b 62 5d 3b 0d 0d | 20 20 20 20 20 20 2f 2a |ad[b];..| /*|
|00003570| 20 53 63 61 6e 20 74 68 | 65 20 63 6f 64 65 20 6f | Scan th|e code o|
|00003580| 66 20 74 68 69 73 20 62 | 61 73 69 63 20 62 6c 6f |f this b|asic blo|
|00003590| 63 6b 2c 20 6e 6f 74 69 | 6e 67 20 77 68 69 63 68 |ck, noti|ng which|
|000035a0| 20 61 6c 6c 6f 63 6e 6f | 73 0d 09 20 61 6e 64 20 | allocno|s.. and |
|000035b0| 68 61 72 64 20 72 65 67 | 73 20 61 72 65 20 62 6f |hard reg|s are bo|
|000035c0| 72 6e 20 6f 72 20 64 69 | 65 2e 20 20 57 68 65 6e |rn or di|e. When|
|000035d0| 20 6f 6e 65 20 69 73 20 | 62 6f 72 6e 2c 0d 09 20 | one is |born,.. |
|000035e0| 72 65 63 6f 72 64 20 61 | 20 63 6f 6e 66 6c 69 63 |record a| conflic|
|000035f0| 74 20 77 69 74 68 20 61 | 6c 6c 20 6f 74 68 65 72 |t with a|ll other|
|00003600| 73 20 63 75 72 72 65 6e | 74 6c 79 20 6c 69 76 65 |s curren|tly live|
|00003610| 2e 20 20 2a 2f 0d 0d 20 | 20 20 20 20 20 77 68 69 |. */.. | whi|
|00003620| 6c 65 20 28 31 29 0d 09 | 7b 0d 09 20 20 72 65 67 |le (1)..|{.. reg|
|00003630| 69 73 74 65 72 20 52 54 | 58 5f 43 4f 44 45 20 63 |ister RT|X_CODE c|
|00003640| 6f 64 65 20 3d 20 47 45 | 54 5f 43 4f 44 45 20 28 |ode = GE|T_CODE (|
|00003650| 69 6e 73 6e 29 3b 0d 09 | 20 20 72 65 67 69 73 74 |insn);..| regist|
|00003660| 65 72 20 72 74 78 20 6c | 69 6e 6b 3b 0d 0d 0d 23 |er rtx l|ink;...#|
|00003670| 69 66 64 65 66 20 4d 50 | 57 0d 20 20 20 20 20 20 |ifdef MP|W. |
|00003680| 53 70 69 6e 43 75 72 73 | 6f 72 28 31 29 3b 0d 23 |SpinCurs|or(1);.#|
|00003690| 65 6e 64 69 66 0d 0d 09 | 20 20 2f 2a 20 4d 61 6b |endif...| /* Mak|
|000036a0| 65 20 72 65 67 73 5f 73 | 65 74 20 61 6e 20 65 6d |e regs_s|et an em|
|000036b0| 70 74 79 20 73 65 74 2e | 20 20 2a 2f 0d 0d 09 20 |pty set.| */... |
|000036c0| 20 6e 5f 72 65 67 73 5f | 73 65 74 20 3d 20 30 3b | n_regs_|set = 0;|
|000036d0| 0d 0d 09 20 20 69 66 20 | 28 63 6f 64 65 20 3d 3d |... if |(code ==|
|000036e0| 20 49 4e 53 4e 20 7c 7c | 20 63 6f 64 65 20 3d 3d | INSN ||| code ==|
|000036f0| 20 43 41 4c 4c 5f 49 4e | 53 4e 20 7c 7c 20 63 6f | CALL_IN|SN || co|
|00003700| 64 65 20 3d 3d 20 4a 55 | 4d 50 5f 49 4e 53 4e 29 |de == JU|MP_INSN)|
|00003710| 0d 09 20 20 20 20 7b 0d | 09 20 20 20 20 20 20 2f |.. {.|. /|
|00003720| 2a 20 4d 61 72 6b 20 61 | 6e 79 20 72 65 67 69 73 |* Mark a|ny regis|
|00003730| 74 65 72 73 20 63 6c 6f | 62 62 65 72 65 64 20 62 |ters clo|bbered b|
|00003740| 79 20 49 4e 53 4e 20 61 | 73 20 6c 69 76 65 2c 0d |y INSN a|s live,.|
|00003750| 09 09 20 73 6f 20 74 68 | 65 79 20 63 6f 6e 66 6c |.. so th|ey confl|
|00003760| 69 63 74 20 77 69 74 68 | 20 74 68 65 20 69 6e 70 |ict with| the inp|
|00003770| 75 74 73 2e 20 20 2a 2f | 0d 0d 09 20 20 20 20 20 |uts. */|... |
|00003780| 20 6e 6f 74 65 5f 73 74 | 6f 72 65 73 20 28 50 41 | note_st|ores (PA|
|00003790| 54 54 45 52 4e 20 28 69 | 6e 73 6e 29 2c 20 6d 61 |TTERN (i|nsn), ma|
|000037a0| 72 6b 5f 72 65 67 5f 63 | 6c 6f 62 62 65 72 29 3b |rk_reg_c|lobber);|
|000037b0| 0d 0d 09 20 20 20 20 20 | 20 2f 2a 20 4d 61 72 6b |... | /* Mark|
|000037c0| 20 61 6e 79 20 72 65 67 | 69 73 74 65 72 73 20 64 | any reg|isters d|
|000037d0| 65 61 64 20 61 66 74 65 | 72 20 49 4e 53 4e 20 61 |ead afte|r INSN a|
|000037e0| 73 20 64 65 61 64 20 6e | 6f 77 2e 20 20 2a 2f 0d |s dead n|ow. */.|
|000037f0| 0d 09 20 20 20 20 20 20 | 66 6f 72 20 28 6c 69 6e |.. |for (lin|
|00003800| 6b 20 3d 20 52 45 47 5f | 4e 4f 54 45 53 20 28 69 |k = REG_|NOTES (i|
|00003810| 6e 73 6e 29 3b 20 6c 69 | 6e 6b 3b 20 6c 69 6e 6b |nsn); li|nk; link|
|00003820| 20 3d 20 58 45 58 50 20 | 28 6c 69 6e 6b 2c 20 31 | = XEXP |(link, 1|
|00003830| 29 29 0d 09 09 69 66 20 | 28 52 45 47 5f 4e 4f 54 |))...if |(REG_NOT|
|00003840| 45 5f 4b 49 4e 44 20 28 | 6c 69 6e 6b 29 20 3d 3d |E_KIND (|link) ==|
|00003850| 20 52 45 47 5f 44 45 41 | 44 29 0d 09 09 20 20 6d | REG_DEA|D)... m|
|00003860| 61 72 6b 5f 72 65 67 5f | 64 65 61 74 68 20 28 58 |ark_reg_|death (X|
|00003870| 45 58 50 20 28 6c 69 6e | 6b 2c 20 30 29 29 3b 0d |EXP (lin|k, 0));.|
|00003880| 0d 09 20 20 20 20 20 20 | 2f 2a 20 4d 61 72 6b 20 |.. |/* Mark |
|00003890| 61 6e 79 20 72 65 67 69 | 73 74 65 72 73 20 73 65 |any regi|sters se|
|000038a0| 74 20 69 6e 20 49 4e 53 | 4e 20 61 73 20 6c 69 76 |t in INS|N as liv|
|000038b0| 65 2c 0d 09 09 20 61 6e | 64 20 6d 61 72 6b 20 74 |e,... an|d mark t|
|000038c0| 68 65 6d 20 61 73 20 63 | 6f 6e 66 6c 69 63 74 69 |hem as c|onflicti|
|000038d0| 6e 67 20 77 69 74 68 20 | 61 6c 6c 20 6f 74 68 65 |ng with |all othe|
|000038e0| 72 20 6c 69 76 65 20 72 | 65 67 73 2e 0d 09 09 20 |r live r|egs.... |
|000038f0| 43 6c 6f 62 62 65 72 73 | 20 61 72 65 20 70 72 6f |Clobbers| are pro|
|00003900| 63 65 73 73 65 64 20 61 | 67 61 69 6e 2c 20 73 6f |cessed a|gain, so|
|00003910| 20 74 68 65 79 20 63 6f | 6e 66 6c 69 63 74 20 77 | they co|nflict w|
|00003920| 69 74 68 0d 09 09 20 74 | 68 65 20 72 65 67 69 73 |ith... t|he regis|
|00003930| 74 65 72 73 20 74 68 61 | 74 20 61 72 65 20 73 65 |ters tha|t are se|
|00003940| 74 2e 20 20 2a 2f 0d 0d | 09 20 20 20 20 20 20 6e |t. */..|. n|
|00003950| 6f 74 65 5f 73 74 6f 72 | 65 73 20 28 50 41 54 54 |ote_stor|es (PATT|
|00003960| 45 52 4e 20 28 69 6e 73 | 6e 29 2c 20 6d 61 72 6b |ERN (ins|n), mark|
|00003970| 5f 72 65 67 5f 73 74 6f | 72 65 29 3b 0d 0d 09 20 |_reg_sto|re);... |
|00003980| 20 20 20 20 20 2f 2a 20 | 4d 61 72 6b 20 61 6e 79 | /* |Mark any|
|00003990| 20 72 65 67 69 73 74 65 | 72 73 20 62 6f 74 68 20 | registe|rs both |
|000039a0| 73 65 74 20 61 6e 64 20 | 64 65 61 64 20 61 66 74 |set and |dead aft|
|000039b0| 65 72 20 49 4e 53 4e 20 | 61 73 20 64 65 61 64 2e |er INSN |as dead.|
|000039c0| 0d 09 09 20 54 68 69 73 | 20 69 73 20 6e 6f 74 20 |... This| is not |
|000039d0| 72 65 64 75 6e 64 61 6e | 74 21 0d 09 09 20 41 20 |redundan|t!... A |
|000039e0| 72 65 67 69 73 74 65 72 | 20 6d 61 79 20 62 65 20 |register| may be |
|000039f0| 73 65 74 20 61 6e 64 20 | 6b 69 6c 6c 65 64 20 69 |set and |killed i|
|00003a00| 6e 20 74 68 65 20 73 61 | 6d 65 20 69 6e 73 6e 2e |n the sa|me insn.|
|00003a10| 0d 09 09 20 49 74 20 69 | 73 20 6e 65 63 65 73 73 |... It i|s necess|
|00003a20| 61 72 79 20 74 6f 20 6d | 61 72 6b 20 74 68 65 6d |ary to m|ark them|
|00003a30| 20 61 73 20 6c 69 76 65 | 2c 20 61 62 6f 76 65 2c | as live|, above,|
|00003a40| 20 74 6f 20 67 65 74 0d | 09 09 20 74 68 65 20 72 | to get.|.. the r|
|00003a50| 69 67 68 74 20 63 6f 6e | 66 6c 69 63 74 73 20 77 |ight con|flicts w|
|00003a60| 69 74 68 69 6e 20 74 68 | 65 20 69 6e 73 6e 2e 20 |ithin th|e insn. |
|00003a70| 20 2a 2f 0d 0d 09 20 20 | 20 20 20 20 77 68 69 6c | */... | whil|
|00003a80| 65 20 28 6e 5f 72 65 67 | 73 5f 73 65 74 20 3e 20 |e (n_reg|s_set > |
|00003a90| 30 29 0d 09 09 69 66 20 | 28 66 69 6e 64 5f 72 65 |0)...if |(find_re|
|00003aa0| 67 6e 6f 5f 6e 6f 74 65 | 20 28 69 6e 73 6e 2c 20 |gno_note| (insn, |
|00003ab0| 52 45 47 5f 44 45 41 44 | 2c 20 52 45 47 4e 4f 20 |REG_DEAD|, REGNO |
|00003ac0| 28 72 65 67 73 5f 73 65 | 74 5b 2d 2d 6e 5f 72 65 |(regs_se|t[--n_re|
|00003ad0| 67 73 5f 73 65 74 5d 29 | 29 29 0d 09 09 20 20 6d |gs_set])|))... m|
|00003ae0| 61 72 6b 5f 72 65 67 5f | 64 65 61 74 68 20 28 72 |ark_reg_|death (r|
|00003af0| 65 67 73 5f 73 65 74 5b | 6e 5f 72 65 67 73 5f 73 |egs_set[|n_regs_s|
|00003b00| 65 74 5d 29 3b 0d 09 09 | 0d 09 20 20 20 20 20 20 |et]);...|.. |
|00003b10| 2f 2a 20 4c 69 6b 65 77 | 69 73 65 20 66 6f 72 20 |/* Likew|ise for |
|00003b20| 72 65 67 73 20 73 65 74 | 20 62 79 20 69 6e 63 72 |regs set| by incr|
|00003b30| 65 6d 65 6e 74 61 74 69 | 6f 6e 2e 20 20 2a 2f 0d |ementati|on. */.|
|00003b40| 0d 09 20 20 20 20 20 20 | 66 6f 72 20 28 6c 69 6e |.. |for (lin|
|00003b50| 6b 20 3d 20 52 45 47 5f | 4e 4f 54 45 53 20 28 69 |k = REG_|NOTES (i|
|00003b60| 6e 73 6e 29 3b 20 6c 69 | 6e 6b 3b 20 6c 69 6e 6b |nsn); li|nk; link|
|00003b70| 20 3d 20 58 45 58 50 20 | 28 6c 69 6e 6b 2c 20 31 | = XEXP |(link, 1|
|00003b80| 29 29 0d 09 09 69 66 20 | 28 52 45 47 5f 4e 4f 54 |))...if |(REG_NOT|
|00003b90| 45 5f 4b 49 4e 44 20 28 | 6c 69 6e 6b 29 20 3d 3d |E_KIND (|link) ==|
|00003ba0| 20 52 45 47 5f 49 4e 43 | 0d 09 09 20 20 20 20 26 | REG_INC|... &|
|00003bb0| 26 20 66 69 6e 64 5f 72 | 65 67 6e 6f 5f 6e 6f 74 |& find_r|egno_not|
|00003bc0| 65 20 28 69 6e 73 6e 2c | 20 52 45 47 5f 44 45 41 |e (insn,| REG_DEA|
|00003bd0| 44 2c 20 52 45 47 4e 4f | 20 28 58 45 58 50 20 28 |D, REGNO| (XEXP (|
|00003be0| 6c 69 6e 6b 2c 20 30 29 | 29 29 29 0d 09 09 20 20 |link, 0)|)))... |
|00003bf0| 6d 61 72 6b 5f 72 65 67 | 5f 64 65 61 74 68 20 28 |mark_reg|_death (|
|00003c00| 58 45 58 50 20 28 6c 69 | 6e 6b 2c 20 30 29 29 3b |XEXP (li|nk, 0));|
|00003c10| 0d 09 20 20 20 20 7d 0d | 0d 09 20 20 69 66 20 28 |.. }.|.. if (|
|00003c20| 69 6e 73 6e 20 3d 3d 20 | 62 61 73 69 63 5f 62 6c |insn == |basic_bl|
|00003c30| 6f 63 6b 5f 65 6e 64 5b | 62 5d 29 0d 09 20 20 20 |ock_end[|b]).. |
|00003c40| 20 62 72 65 61 6b 3b 0d | 09 20 20 69 6e 73 6e 20 | break;.|. insn |
|00003c50| 3d 20 4e 45 58 54 5f 49 | 4e 53 4e 20 28 69 6e 73 |= NEXT_I|NSN (ins|
|00003c60| 6e 29 3b 0d 09 7d 0d 20 | 20 20 20 7d 0d 7d 0d 0c |n);..}. | }.}..|
|00003c70| 0d 2f 2a 20 41 73 73 69 | 67 6e 20 61 20 68 61 72 |./* Assi|gn a har|
|00003c80| 64 20 72 65 67 69 73 74 | 65 72 20 74 6f 20 41 4c |d regist|er to AL|
|00003c90| 4c 4f 43 4e 4f 3b 20 6c | 6f 6f 6b 20 66 6f 72 20 |LOCNO; l|ook for |
|00003ca0| 6f 6e 65 20 74 68 61 74 | 20 69 73 20 74 68 65 20 |one that| is the |
|00003cb0| 62 65 67 69 6e 6e 69 6e | 67 0d 20 20 20 6f 66 20 |beginnin|g. of |
|00003cc0| 61 20 6c 6f 6e 67 20 65 | 6e 6f 75 67 68 20 73 74 |a long e|nough st|
|00003cd0| 72 65 74 63 68 20 6f 66 | 20 68 61 72 64 20 72 65 |retch of| hard re|
|00003ce0| 67 73 20 6e 6f 6e 65 20 | 6f 66 20 77 68 69 63 68 |gs none |of which|
|00003cf0| 20 63 6f 6e 66 6c 69 63 | 74 73 20 77 69 74 68 20 | conflic|ts with |
|00003d00| 41 4c 4c 4f 43 4e 4f 2e | 0d 20 20 20 54 68 65 20 |ALLOCNO.|. The |
|00003d10| 72 65 67 69 73 74 65 72 | 73 20 6d 61 72 6b 65 64 |register|s marked|
|00003d20| 20 69 6e 20 50 52 45 46 | 52 45 47 53 20 61 72 65 | in PREF|REGS are|
|00003d30| 20 74 72 69 65 64 20 66 | 69 72 73 74 2e 0d 0d 20 | tried f|irst... |
|00003d40| 20 20 49 66 20 41 4c 4c | 5f 52 45 47 53 5f 50 20 | If ALL|_REGS_P |
|00003d50| 69 73 20 7a 65 72 6f 2c | 20 63 6f 6e 73 69 64 65 |is zero,| conside|
|00003d60| 72 20 6f 6e 6c 79 20 74 | 68 65 20 70 72 65 66 65 |r only t|he prefe|
|00003d70| 72 72 65 64 20 63 6c 61 | 73 73 20 6f 66 20 41 4c |rred cla|ss of AL|
|00003d80| 4c 4f 43 4e 4f 27 73 20 | 72 65 67 2e 0d 20 20 20 |LOCNO's |reg.. |
|00003d90| 4f 74 68 65 72 77 69 73 | 65 20 69 67 6e 6f 72 65 |Otherwis|e ignore|
|00003da0| 20 74 68 61 74 20 70 72 | 65 66 65 72 72 65 64 20 | that pr|eferred |
|00003db0| 63 6c 61 73 73 2e 0d 0d | 20 20 20 49 66 20 41 43 |class...| If AC|
|00003dc0| 43 45 50 54 5f 43 41 4c | 4c 5f 43 4c 4f 42 42 45 |CEPT_CAL|L_CLOBBE|
|00003dd0| 52 45 44 20 69 73 20 6e | 6f 6e 7a 65 72 6f 2c 20 |RED is n|onzero, |
|00003de0| 61 63 63 65 70 74 20 61 | 20 63 61 6c 6c 2d 63 6c |accept a| call-cl|
|00003df0| 6f 62 62 65 72 65 64 20 | 68 61 72 64 20 72 65 67 |obbered |hard reg|
|00003e00| 20 74 68 61 74 0d 20 20 | 20 77 69 6c 6c 20 68 61 | that. | will ha|
|00003e10| 76 65 20 74 6f 20 62 65 | 20 73 61 76 65 64 20 61 |ve to be| saved a|
|00003e20| 6e 64 20 72 65 73 74 6f | 72 65 64 20 61 74 20 63 |nd resto|red at c|
|00003e30| 61 6c 6c 73 2e 0d 0d 20 | 20 20 49 66 20 77 65 20 |alls... | If we |
|00003e40| 66 69 6e 64 20 6f 6e 65 | 2c 20 72 65 63 6f 72 64 |find one|, record|
|00003e50| 20 69 74 20 69 6e 20 72 | 65 67 5f 72 65 6e 75 6d | it in r|eg_renum|
|00003e60| 62 65 72 2e 0d 20 20 20 | 49 66 20 6e 6f 74 2c 20 |ber.. |If not, |
|00003e70| 64 6f 20 6e 6f 74 68 69 | 6e 67 2e 20 20 2a 2f 0d |do nothi|ng. */.|
|00003e80| 0d 73 74 61 74 69 63 20 | 76 6f 69 64 0d 66 69 6e |.static |void.fin|
|00003e90| 64 5f 72 65 67 20 28 61 | 6c 6c 6f 63 6e 6f 2c 20 |d_reg (a|llocno, |
|00003ea0| 6c 6f 73 65 72 73 2c 20 | 61 6c 6c 5f 72 65 67 73 |losers, |all_regs|
|00003eb0| 5f 70 2c 20 61 63 63 65 | 70 74 5f 63 61 6c 6c 5f |_p, acce|pt_call_|
|00003ec0| 63 6c 6f 62 62 65 72 65 | 64 2c 20 70 72 65 66 72 |clobbere|d, prefr|
|00003ed0| 65 67 73 29 0d 20 20 20 | 20 20 69 6e 74 20 61 6c |egs). | int al|
|00003ee0| 6c 6f 63 6e 6f 3b 0d 20 | 20 20 20 20 72 65 67 69 |locno;. | regi|
|00003ef0| 73 74 65 72 20 73 68 6f | 72 74 20 2a 6c 6f 73 65 |ster sho|rt *lose|
|00003f00| 72 73 3b 0d 20 20 20 20 | 20 69 6e 74 20 61 6c 6c |rs;. | int all|
|00003f10| 5f 72 65 67 73 5f 70 3b | 0d 20 20 20 20 20 69 6e |_regs_p;|. in|
|00003f20| 74 20 61 63 63 65 70 74 | 5f 63 61 6c 6c 5f 63 6c |t accept|_call_cl|
|00003f30| 6f 62 62 65 72 65 64 3b | 0d 20 20 20 20 20 48 41 |obbered;|. HA|
|00003f40| 52 44 5f 52 45 47 5f 53 | 45 54 20 70 72 65 66 72 |RD_REG_S|ET prefr|
|00003f50| 65 67 73 3b 0d 7b 0d 20 | 20 72 65 67 69 73 74 65 |egs;.{. | registe|
|00003f60| 72 20 69 6e 74 20 69 2c | 20 70 72 65 66 72 65 67 |r int i,| prefreg|
|00003f70| 2c 20 70 61 73 73 3b 0d | 23 69 66 64 65 66 20 48 |, pass;.|#ifdef H|
|00003f80| 41 52 44 5f 52 45 47 5f | 53 45 54 0d 20 20 72 65 |ARD_REG_|SET. re|
|00003f90| 67 69 73 74 65 72 09 09 | 2f 2a 20 44 65 63 6c 61 |gister..|/* Decla|
|00003fa0| 72 65 20 69 74 20 72 65 | 67 69 73 74 65 72 20 69 |re it re|gister i|
|00003fb0| 66 20 69 74 27 73 20 61 | 20 73 63 61 6c 61 72 2e |f it's a| scalar.|
|00003fc0| 20 20 2a 2f 0d 23 65 6e | 64 69 66 0d 20 20 20 20 | */.#en|dif. |
|00003fd0| 48 41 52 44 5f 52 45 47 | 5f 53 45 54 20 75 73 65 |HARD_REG|_SET use|
|00003fe0| 64 3b 0d 0d 20 20 65 6e | 75 6d 20 72 65 67 5f 63 |d;.. en|um reg_c|
|00003ff0| 6c 61 73 73 20 63 6c 61 | 73 73 20 0d 20 20 20 20 |lass cla|ss . |
|00004000| 3d 20 61 6c 6c 5f 72 65 | 67 73 5f 70 20 3f 20 47 |= all_re|gs_p ? G|
|00004010| 45 4e 45 52 41 4c 5f 52 | 45 47 53 20 3a 20 72 65 |ENERAL_R|EGS : re|
|00004020| 67 5f 70 72 65 66 65 72 | 72 65 64 5f 63 6c 61 73 |g_prefer|red_clas|
|00004030| 73 20 28 61 6c 6c 6f 63 | 6e 6f 5f 72 65 67 5b 61 |s (alloc|no_reg[a|
|00004040| 6c 6c 6f 63 6e 6f 5d 29 | 3b 0d 20 20 65 6e 75 6d |llocno])|;. enum|
|00004050| 20 6d 61 63 68 69 6e 65 | 5f 6d 6f 64 65 20 6d 6f | machine|_mode mo|
|00004060| 64 65 20 3d 20 50 53 45 | 55 44 4f 5f 52 45 47 4e |de = PSE|UDO_REGN|
|00004070| 4f 5f 4d 4f 44 45 20 28 | 61 6c 6c 6f 63 6e 6f 5f |O_MODE (|allocno_|
|00004080| 72 65 67 5b 61 6c 6c 6f | 63 6e 6f 5d 29 3b 0d 0d |reg[allo|cno]);..|
|00004090| 20 20 69 66 20 28 61 63 | 63 65 70 74 5f 63 61 6c | if (ac|cept_cal|
|000040a0| 6c 5f 63 6c 6f 62 62 65 | 72 65 64 29 0d 20 20 20 |l_clobbe|red). |
|000040b0| 20 43 4f 50 59 5f 48 41 | 52 44 5f 52 45 47 5f 53 | COPY_HA|RD_REG_S|
|000040c0| 45 54 20 28 75 73 65 64 | 2c 20 63 61 6c 6c 5f 66 |ET (used|, call_f|
|000040d0| 69 78 65 64 5f 72 65 67 | 5f 73 65 74 29 3b 0d 20 |ixed_reg|_set);. |
|000040e0| 20 65 6c 73 65 20 69 66 | 20 28 72 65 67 5f 6e 5f | else if| (reg_n_|
|000040f0| 63 61 6c 6c 73 5f 63 72 | 6f 73 73 65 64 5b 61 6c |calls_cr|ossed[al|
|00004100| 6c 6f 63 6e 6f 5f 72 65 | 67 5b 61 6c 6c 6f 63 6e |locno_re|g[allocn|
|00004110| 6f 5d 5d 20 3d 3d 20 30 | 29 0d 20 20 20 20 43 4f |o]] == 0|). CO|
|00004120| 50 59 5f 48 41 52 44 5f | 52 45 47 5f 53 45 54 20 |PY_HARD_|REG_SET |
|00004130| 28 75 73 65 64 2c 20 66 | 69 78 65 64 5f 72 65 67 |(used, f|ixed_reg|
|00004140| 5f 73 65 74 29 3b 0d 20 | 20 65 6c 73 65 0d 20 20 |_set);. | else. |
|00004150| 20 20 43 4f 50 59 5f 48 | 41 52 44 5f 52 45 47 5f | COPY_H|ARD_REG_|
|00004160| 53 45 54 20 28 75 73 65 | 64 2c 20 63 61 6c 6c 5f |SET (use|d, call_|
|00004170| 75 73 65 64 5f 72 65 67 | 5f 73 65 74 29 3b 0d 0d |used_reg|_set);..|
|00004180| 20 20 2f 2a 20 53 6f 6d | 65 20 72 65 67 69 73 74 | /* Som|e regist|
|00004190| 65 72 73 20 73 68 6f 75 | 6c 64 20 6e 6f 74 20 62 |ers shou|ld not b|
|000041a0| 65 20 61 6c 6c 6f 63 61 | 74 65 64 20 69 6e 20 67 |e alloca|ted in g|
|000041b0| 6c 6f 62 61 6c 2d 61 6c | 6c 6f 63 2e 20 20 2a 2f |lobal-al|loc. */|
|000041c0| 0d 20 20 49 4f 52 5f 48 | 41 52 44 5f 52 45 47 5f |. IOR_H|ARD_REG_|
|000041d0| 53 45 54 20 28 75 73 65 | 64 2c 20 6e 6f 5f 67 6c |SET (use|d, no_gl|
|000041e0| 6f 62 61 6c 5f 61 6c 6c | 6f 63 5f 72 65 67 73 29 |obal_all|oc_regs)|
|000041f0| 3b 0d 0d 20 20 49 4f 52 | 5f 43 4f 4d 50 4c 5f 48 |;.. IOR|_COMPL_H|
|00004200| 41 52 44 5f 52 45 47 5f | 53 45 54 20 28 75 73 65 |ARD_REG_|SET (use|
|00004210| 64 2c 20 72 65 67 5f 63 | 6c 61 73 73 5f 63 6f 6e |d, reg_c|lass_con|
|00004220| 74 65 6e 74 73 5b 28 69 | 6e 74 29 20 63 6c 61 73 |tents[(i|nt) clas|
|00004230| 73 5d 29 3b 0d 20 20 49 | 4f 52 5f 48 41 52 44 5f |s]);. I|OR_HARD_|
|00004240| 52 45 47 5f 53 45 54 20 | 28 75 73 65 64 2c 20 68 |REG_SET |(used, h|
|00004250| 61 72 64 5f 72 65 67 5f | 63 6f 6e 66 6c 69 63 74 |ard_reg_|conflict|
|00004260| 73 5b 61 6c 6c 6f 63 6e | 6f 5d 29 3b 0d 20 20 69 |s[allocn|o]);. i|
|00004270| 66 20 28 66 72 61 6d 65 | 5f 70 6f 69 6e 74 65 72 |f (frame|_pointer|
|00004280| 5f 6e 65 65 64 65 64 29 | 0d 20 20 20 20 53 45 54 |_needed)|. SET|
|00004290| 5f 48 41 52 44 5f 52 45 | 47 5f 42 49 54 20 28 75 |_HARD_RE|G_BIT (u|
|000042a0| 73 65 64 2c 20 46 52 41 | 4d 45 5f 50 4f 49 4e 54 |sed, FRA|ME_POINT|
|000042b0| 45 52 5f 52 45 47 4e 55 | 4d 29 3b 0d 0d 20 20 41 |ER_REGNU|M);.. A|
|000042c0| 4e 44 5f 43 4f 4d 50 4c | 5f 48 41 52 44 5f 52 45 |ND_COMPL|_HARD_RE|
|000042d0| 47 5f 53 45 54 20 28 70 | 72 65 66 72 65 67 73 2c |G_SET (p|refregs,|
|000042e0| 20 75 73 65 64 29 3b 0d | 0d 20 20 2f 2a 20 54 72 | used);.|. /* Tr|
|000042f0| 79 20 74 6f 20 66 69 6e | 64 20 61 20 72 65 67 69 |y to fin|d a regi|
|00004300| 73 74 65 72 20 66 72 6f | 6d 20 74 68 65 20 70 72 |ster fro|m the pr|
|00004310| 65 66 65 72 72 65 64 20 | 73 65 74 20 66 69 72 73 |eferred |set firs|
|00004320| 74 2e 20 2a 2f 0d 0d 20 | 20 69 20 3d 20 2d 31 3b |t. */.. | i = -1;|
|00004330| 0d 20 20 66 6f 72 20 28 | 70 72 65 66 72 65 67 20 |. for (|prefreg |
|00004340| 3d 20 30 3b 20 70 72 65 | 66 72 65 67 20 3c 20 46 |= 0; pre|freg < F|
|00004350| 49 52 53 54 5f 50 53 45 | 55 44 4f 5f 52 45 47 49 |IRST_PSE|UDO_REGI|
|00004360| 53 54 45 52 3b 20 70 72 | 65 66 72 65 67 2b 2b 29 |STER; pr|efreg++)|
|00004370| 0d 20 20 20 20 69 66 20 | 28 54 45 53 54 5f 48 41 |. if |(TEST_HA|
|00004380| 52 44 5f 52 45 47 5f 42 | 49 54 20 28 70 72 65 66 |RD_REG_B|IT (pref|
|00004390| 72 65 67 73 2c 20 70 72 | 65 66 72 65 67 29 0d 09 |regs, pr|efreg)..|
|000043a0| 26 26 20 28 6c 6f 73 65 | 72 73 20 3d 3d 20 30 20 |&& (lose|rs == 0 |
|000043b0| 7c 7c 20 6c 6f 73 65 72 | 73 5b 70 72 65 66 72 65 ||| loser|s[prefre|
|000043c0| 67 5d 20 3c 20 30 29 0d | 09 26 26 20 48 41 52 44 |g] < 0).|.&& HARD|
|000043d0| 5f 52 45 47 4e 4f 5f 4d | 4f 44 45 5f 4f 4b 20 28 |_REGNO_M|ODE_OK (|
|000043e0| 70 72 65 66 72 65 67 2c | 20 6d 6f 64 65 29 29 0d |prefreg,| mode)).|
|000043f0| 20 20 20 20 20 20 7b 0d | 09 72 65 67 69 73 74 65 | {.|.registe|
|00004400| 72 20 69 6e 74 20 6a 3b | 0d 09 72 65 67 69 73 74 |r int j;|..regist|
|00004410| 65 72 20 69 6e 74 20 6c | 69 6d 20 3d 20 70 72 65 |er int l|im = pre|
|00004420| 66 72 65 67 20 2b 20 48 | 41 52 44 5f 52 45 47 4e |freg + H|ARD_REGN|
|00004430| 4f 5f 4e 52 45 47 53 20 | 28 70 72 65 66 72 65 67 |O_NREGS |(prefreg|
|00004440| 2c 20 6d 6f 64 65 29 3b | 0d 09 66 6f 72 20 28 6a |, mode);|..for (j|
|00004450| 20 3d 20 70 72 65 66 72 | 65 67 20 2b 20 31 3b 0d | = prefr|eg + 1;.|
|00004460| 09 20 20 20 20 20 28 6a | 20 3c 20 6c 69 6d 0d 09 |. (j| < lim..|
|00004470| 20 20 20 20 20 20 26 26 | 20 21 20 54 45 53 54 5f | &&| ! TEST_|
|00004480| 48 41 52 44 5f 52 45 47 | 5f 42 49 54 20 28 75 73 |HARD_REG|_BIT (us|
|00004490| 65 64 2c 20 6a 29 0d 09 | 20 20 20 20 20 20 26 26 |ed, j)..| &&|
|000044a0| 20 28 6c 6f 73 65 72 73 | 20 3d 3d 20 30 20 7c 7c | (losers| == 0 |||
|000044b0| 20 6c 6f 73 65 72 73 5b | 6a 5d 20 3c 20 30 29 29 | losers[|j] < 0))|
|000044c0| 3b 0d 09 20 20 20 20 20 | 6a 2b 2b 29 3b 0d 09 69 |;.. |j++);..i|
|000044d0| 66 20 28 6a 20 3d 3d 20 | 6c 69 6d 29 0d 09 20 20 |f (j == |lim).. |
|000044e0| 7b 0d 09 20 20 20 20 69 | 20 3d 20 70 72 65 66 72 |{.. i| = prefr|
|000044f0| 65 67 3b 0d 09 20 20 20 | 20 62 72 65 61 6b 3b 0d |eg;.. | break;.|
|00004500| 09 20 20 7d 0d 20 20 20 | 20 20 20 7d 0d 0d 0d 23 |. }. | }...#|
|00004510| 69 66 64 65 66 20 4d 50 | 57 0d 20 20 53 70 69 6e |ifdef MP|W. Spin|
|00004520| 43 75 72 73 6f 72 28 31 | 29 3b 0d 23 65 6e 64 69 |Cursor(1|);.#endi|
|00004530| 66 0d 0d 23 69 66 20 30 | 0d 20 20 2f 2a 20 4f 74 |f..#if 0|. /* Ot|
|00004540| 68 65 72 77 69 73 65 20 | 74 72 79 20 65 61 63 68 |herwise |try each|
|00004550| 20 68 61 72 64 20 72 65 | 67 20 74 6f 20 73 65 65 | hard re|g to see|
|00004560| 20 69 66 20 69 74 20 66 | 69 74 73 2e 20 20 44 6f | if it f|its. Do|
|00004570| 20 74 68 69 73 20 69 6e | 20 74 77 6f 20 70 61 73 | this in| two pas|
|00004580| 73 65 73 2e 0d 20 20 20 | 20 20 49 6e 20 74 68 65 |ses.. | In the|
|00004590| 20 66 69 72 73 74 20 70 | 61 73 73 2c 20 73 6b 69 | first p|ass, ski|
|000045a0| 70 20 72 65 67 69 73 74 | 65 72 73 20 74 68 61 74 |p regist|ers that|
|000045b0| 20 61 72 65 20 70 72 65 | 66 65 72 65 64 20 62 79 | are pre|fered by|
|000045c0| 20 73 6f 6d 65 20 70 73 | 65 75 64 6f 20 74 6f 0d | some ps|eudo to.|
|000045d0| 20 20 20 20 20 67 69 76 | 65 20 69 74 20 61 20 62 | giv|e it a b|
|000045e0| 65 74 74 65 72 20 63 68 | 61 6e 63 65 20 6f 66 20 |etter ch|ance of |
|000045f0| 67 65 74 74 69 6e 67 20 | 6f 6e 65 20 6f 66 20 74 |getting |one of t|
|00004600| 68 6f 73 65 20 72 65 67 | 69 73 74 65 72 73 2e 20 |hose reg|isters. |
|00004610| 20 4f 6e 6c 79 20 69 66 | 0d 20 20 20 20 20 77 65 | Only if|. we|
|00004620| 20 63 61 6e 27 74 20 67 | 65 74 20 61 20 72 65 67 | can't g|et a reg|
|00004630| 69 73 74 65 72 20 77 68 | 65 6e 20 65 78 63 6c 75 |ister wh|en exclu|
|00004640| 64 69 6e 67 20 74 68 6f | 73 65 20 64 6f 20 77 65 |ding tho|se do we|
|00004650| 20 74 61 6b 65 20 6f 6e | 65 20 6f 66 20 74 68 65 | take on|e of the|
|00004660| 6d 2e 20 20 2a 2f 0d 0d | 20 20 2f 2a 20 54 68 69 |m. */..| /* Thi|
|00004670| 73 20 69 73 20 74 75 72 | 6e 65 64 20 6f 66 66 20 |s is tur|ned off |
|00004680| 62 65 63 61 75 73 65 20 | 69 74 20 6d 61 6b 65 73 |because |it makes|
|00004690| 20 77 6f 72 73 65 20 61 | 6c 6c 6f 63 61 74 69 6f | worse a|llocatio|
|000046a0| 6e 20 6f 6e 20 74 68 65 | 20 36 38 30 32 30 2e 20 |n on the| 68020. |
|000046b0| 20 2a 2f 0d 20 20 66 6f | 72 20 28 70 61 73 73 20 | */. fo|r (pass |
|000046c0| 3d 20 30 3b 20 70 61 73 | 73 20 3c 3d 20 31 20 26 |= 0; pas|s <= 1 &|
|000046d0| 26 20 69 20 3c 20 30 3b | 20 70 61 73 73 2b 2b 29 |& i < 0;| pass++)|
|000046e0| 0d 23 65 6e 64 69 66 0d | 20 20 70 61 73 73 20 3d |.#endif.| pass =|
|000046f0| 20 31 3b 0d 20 20 20 20 | 66 6f 72 20 28 69 20 3d | 1;. |for (i =|
|00004700| 20 30 3b 20 69 20 3c 20 | 46 49 52 53 54 5f 50 53 | 0; i < |FIRST_PS|
|00004710| 45 55 44 4f 5f 52 45 47 | 49 53 54 45 52 3b 20 69 |EUDO_REG|ISTER; i|
|00004720| 2b 2b 29 0d 20 20 20 20 | 20 20 7b 0d 23 69 66 64 |++). | {.#ifd|
|00004730| 65 66 20 52 45 47 5f 41 | 4c 4c 4f 43 5f 4f 52 44 |ef REG_A|LLOC_ORD|
|00004740| 45 52 0d 09 69 6e 74 20 | 72 65 67 6e 6f 20 3d 20 |ER..int |regno = |
|00004750| 72 65 67 5f 61 6c 6c 6f | 63 5f 6f 72 64 65 72 5b |reg_allo|c_order[|
|00004760| 69 5d 3b 0d 23 65 6c 73 | 65 0d 09 69 6e 74 20 72 |i];.#els|e..int r|
|00004770| 65 67 6e 6f 20 3d 20 69 | 3b 0d 23 65 6e 64 69 66 |egno = i|;.#endif|
|00004780| 0d 09 69 66 20 28 21 20 | 54 45 53 54 5f 48 41 52 |..if (! |TEST_HAR|
|00004790| 44 5f 52 45 47 5f 42 49 | 54 20 28 75 73 65 64 2c |D_REG_BI|T (used,|
|000047a0| 20 72 65 67 6e 6f 29 0d | 09 20 20 20 20 26 26 20 | regno).|. && |
|000047b0| 28 6c 6f 73 65 72 73 20 | 3d 3d 20 30 20 7c 7c 20 |(losers |== 0 || |
|000047c0| 6c 6f 73 65 72 73 5b 72 | 65 67 6e 6f 5d 20 3c 20 |losers[r|egno] < |
|000047d0| 30 29 0d 09 20 20 20 20 | 26 26 20 28 70 61 73 73 |0).. |&& (pass|
|000047e0| 20 3d 3d 20 31 20 7c 7c | 20 21 20 54 45 53 54 5f | == 1 ||| ! TEST_|
|000047f0| 48 41 52 44 5f 52 45 47 | 5f 42 49 54 20 28 72 65 |HARD_REG|_BIT (re|
|00004800| 67 73 5f 73 6f 6d 65 6f | 6e 65 5f 70 72 65 66 65 |gs_someo|ne_prefe|
|00004810| 72 73 2c 20 72 65 67 6e | 6f 29 29 0d 09 20 20 20 |rs, regn|o)).. |
|00004820| 20 26 26 20 48 41 52 44 | 5f 52 45 47 4e 4f 5f 4d | && HARD|_REGNO_M|
|00004830| 4f 44 45 5f 4f 4b 20 28 | 72 65 67 6e 6f 2c 20 6d |ODE_OK (|regno, m|
|00004840| 6f 64 65 29 29 0d 09 20 | 20 7b 0d 09 20 20 20 20 |ode)).. | {.. |
|00004850| 72 65 67 69 73 74 65 72 | 20 69 6e 74 20 6a 3b 0d |register| int j;.|
|00004860| 09 20 20 20 20 72 65 67 | 69 73 74 65 72 20 69 6e |. reg|ister in|
|00004870| 74 20 6c 69 6d 20 3d 20 | 72 65 67 6e 6f 20 2b 20 |t lim = |regno + |
|00004880| 48 41 52 44 5f 52 45 47 | 4e 4f 5f 4e 52 45 47 53 |HARD_REG|NO_NREGS|
|00004890| 20 28 72 65 67 6e 6f 2c | 20 6d 6f 64 65 29 3b 0d | (regno,| mode);.|
|000048a0| 09 20 20 20 20 66 6f 72 | 20 28 6a 20 3d 20 72 65 |. for| (j = re|
|000048b0| 67 6e 6f 20 2b 20 31 3b | 0d 09 09 20 28 6a 20 3c |gno + 1;|... (j <|
|000048c0| 20 6c 69 6d 0d 09 09 20 | 20 26 26 20 21 20 54 45 | lim... | && ! TE|
|000048d0| 53 54 5f 48 41 52 44 5f | 52 45 47 5f 42 49 54 20 |ST_HARD_|REG_BIT |
|000048e0| 28 75 73 65 64 2c 20 6a | 29 0d 09 09 20 20 26 26 |(used, j|)... &&|
|000048f0| 20 28 6c 6f 73 65 72 73 | 20 3d 3d 20 30 20 7c 7c | (losers| == 0 |||
|00004900| 20 6c 6f 73 65 72 73 5b | 6a 5d 20 3c 20 30 29 29 | losers[|j] < 0))|
|00004910| 3b 0d 09 09 20 6a 2b 2b | 29 3b 0d 09 20 20 20 20 |;... j++|);.. |
|00004920| 69 66 20 28 6a 20 3d 3d | 20 6c 69 6d 29 0d 09 20 |if (j ==| lim).. |
|00004930| 20 20 20 20 20 7b 0d 09 | 09 69 20 3d 20 72 65 67 | {..|.i = reg|
|00004940| 6e 6f 3b 0d 09 09 62 72 | 65 61 6b 3b 0d 09 20 20 |no;...br|eak;.. |
|00004950| 20 20 20 20 7d 0d 23 69 | 66 6e 64 65 66 20 52 45 | }.#i|fndef RE|
|00004960| 47 5f 41 4c 4c 4f 43 5f | 4f 52 44 45 52 0d 09 20 |G_ALLOC_|ORDER.. |
|00004970| 20 20 20 69 20 3d 20 6a | 3b 09 09 09 2f 2a 20 53 | i = j|;.../* S|
|00004980| 6b 69 70 20 73 74 61 72 | 74 69 6e 67 20 70 6f 69 |kip star|ting poi|
|00004990| 6e 74 73 20 77 65 20 6b | 6e 6f 77 20 77 69 6c 6c |nts we k|now will|
|000049a0| 20 6c 6f 73 65 20 2a 2f | 0d 23 65 6e 64 69 66 0d | lose */|.#endif.|
|000049b0| 09 20 20 7d 0d 20 20 20 | 20 20 20 7d 0d 0d 20 20 |. }. | }.. |
|000049c0| 2f 2a 20 44 69 64 20 77 | 65 20 66 69 6e 64 20 61 |/* Did w|e find a|
|000049d0| 20 72 65 67 69 73 74 65 | 72 3f 20 20 2a 2f 0d 0d | registe|r? */..|
|000049e0| 20 20 69 66 20 28 69 20 | 3c 20 46 49 52 53 54 5f | if (i |< FIRST_|
|000049f0| 50 53 45 55 44 4f 5f 52 | 45 47 49 53 54 45 52 29 |PSEUDO_R|EGISTER)|
|00004a00| 0d 20 20 20 20 7b 0d 20 | 20 20 20 20 20 72 65 67 |. {. | reg|
|00004a10| 69 73 74 65 72 20 69 6e | 74 20 6c 69 6d 2c 20 6a |ister in|t lim, j|
|00004a20| 3b 0d 20 20 20 20 20 20 | 48 41 52 44 5f 52 45 47 |;. |HARD_REG|
|00004a30| 5f 53 45 54 20 74 68 69 | 73 5f 72 65 67 3b 0d 0d |_SET thi|s_reg;..|
|00004a40| 20 20 20 20 20 20 2f 2a | 20 59 65 73 2e 20 20 52 | /*| Yes. R|
|00004a50| 65 63 6f 72 64 20 69 74 | 20 61 73 20 74 68 65 20 |ecord it| as the |
|00004a60| 68 61 72 64 20 72 65 67 | 69 73 74 65 72 20 6f 66 |hard reg|ister of|
|00004a70| 20 74 68 69 73 20 70 73 | 65 75 64 6f 2d 72 65 67 | this ps|eudo-reg|
|00004a80| 2e 20 20 2a 2f 0d 20 20 | 20 20 20 20 72 65 67 5f |. */. | reg_|
|00004a90| 72 65 6e 75 6d 62 65 72 | 5b 61 6c 6c 6f 63 6e 6f |renumber|[allocno|
|00004aa0| 5f 72 65 67 5b 61 6c 6c | 6f 63 6e 6f 5d 5d 20 3d |_reg[all|ocno]] =|
|00004ab0| 20 69 3b 0d 20 20 20 20 | 20 20 2f 2a 20 46 6f 72 | i;. | /* For|
|00004ac0| 20 65 61 63 68 20 6f 74 | 68 65 72 20 70 73 65 75 | each ot|her pseu|
|00004ad0| 64 6f 2d 72 65 67 20 63 | 6f 6e 66 6c 69 63 74 69 |do-reg c|onflicti|
|00004ae0| 6e 67 20 77 69 74 68 20 | 74 68 69 73 20 6f 6e 65 |ng with |this one|
|00004af0| 2c 0d 09 20 6d 61 72 6b | 20 69 74 20 61 73 20 63 |,.. mark| it as c|
|00004b00| 6f 6e 66 6c 69 63 74 69 | 6e 67 20 77 69 74 68 20 |onflicti|ng with |
|00004b10| 74 68 65 20 68 61 72 64 | 20 72 65 67 73 20 74 68 |the hard| regs th|
|00004b20| 69 73 20 6f 6e 65 20 6f | 63 63 75 70 69 65 73 2e |is one o|ccupies.|
|00004b30| 20 20 2a 2f 0d 20 20 20 | 20 20 20 43 4c 45 41 52 | */. | CLEAR|
|00004b40| 5f 48 41 52 44 5f 52 45 | 47 5f 53 45 54 20 28 74 |_HARD_RE|G_SET (t|
|00004b50| 68 69 73 5f 72 65 67 29 | 3b 0d 20 20 20 20 20 20 |his_reg)|;. |
|00004b60| 6c 69 6d 20 3d 20 69 20 | 2b 20 48 41 52 44 5f 52 |lim = i |+ HARD_R|
|00004b70| 45 47 4e 4f 5f 4e 52 45 | 47 53 20 28 69 2c 20 6d |EGNO_NRE|GS (i, m|
|00004b80| 6f 64 65 29 3b 0d 20 20 | 20 20 20 20 66 6f 72 20 |ode);. | for |
|00004b90| 28 6a 20 3d 20 69 3b 20 | 6a 20 3c 20 6c 69 6d 3b |(j = i; |j < lim;|
|00004ba0| 20 6a 2b 2b 29 0d 09 53 | 45 54 5f 48 41 52 44 5f | j++)..S|ET_HARD_|
|00004bb0| 52 45 47 5f 42 49 54 20 | 28 74 68 69 73 5f 72 65 |REG_BIT |(this_re|
|00004bc0| 67 2c 20 6a 29 3b 0d 20 | 20 20 20 20 20 6c 69 6d |g, j);. | lim|
|00004bd0| 20 3d 20 61 6c 6c 6f 63 | 6e 6f 3b 0d 20 20 20 20 | = alloc|no;. |
|00004be0| 20 20 66 6f 72 20 28 6a | 20 3d 20 30 3b 20 6a 20 | for (j| = 0; j |
|00004bf0| 3c 20 6d 61 78 5f 61 6c | 6c 6f 63 6e 6f 3b 20 6a |< max_al|locno; j|
|00004c00| 2b 2b 29 0d 09 69 66 20 | 28 43 4f 4e 46 4c 49 43 |++)..if |(CONFLIC|
|00004c10| 54 50 20 28 6c 69 6d 2c | 20 6a 29 20 7c 7c 20 43 |TP (lim,| j) || C|
|00004c20| 4f 4e 46 4c 49 43 54 50 | 20 28 6a 2c 20 6c 69 6d |ONFLICTP| (j, lim|
|00004c30| 29 29 0d 09 20 20 7b 0d | 09 20 20 20 20 49 4f 52 |)).. {.|. IOR|
|00004c40| 5f 48 41 52 44 5f 52 45 | 47 5f 53 45 54 20 28 68 |_HARD_RE|G_SET (h|
|00004c50| 61 72 64 5f 72 65 67 5f | 63 6f 6e 66 6c 69 63 74 |ard_reg_|conflict|
|00004c60| 73 5b 6a 5d 2c 20 74 68 | 69 73 5f 72 65 67 29 3b |s[j], th|is_reg);|
|00004c70| 0d 09 20 20 7d 0d 20 20 | 20 20 7d 0d 20 20 65 6c |.. }. | }. el|
|00004c80| 73 65 20 69 66 20 28 66 | 6c 61 67 5f 63 61 6c 6c |se if (f|lag_call|
|00004c90| 65 72 5f 73 61 76 65 73 | 29 0d 20 20 20 20 7b 0d |er_saves|). {.|
|00004ca0| 20 20 20 20 20 20 2f 2a | 20 44 69 64 20 6e 6f 74 | /*| Did not|
|00004cb0| 20 66 69 6e 64 20 61 20 | 72 65 67 69 73 74 65 72 | find a |register|
|00004cc0| 2e 20 20 49 66 20 69 74 | 20 77 6f 75 6c 64 20 62 |. If it| would b|
|00004cd0| 65 20 70 72 6f 66 69 74 | 61 62 6c 65 20 74 6f 0d |e profit|able to.|
|00004ce0| 09 20 61 6c 6c 6f 63 61 | 74 65 20 61 20 63 61 6c |. alloca|te a cal|
|00004cf0| 6c 2d 63 6c 6f 62 62 65 | 72 65 64 20 72 65 67 69 |l-clobbe|red regi|
|00004d00| 73 74 65 72 20 61 6e 64 | 20 73 61 76 65 20 61 6e |ster and| save an|
|00004d10| 64 20 72 65 73 74 6f 72 | 65 20 69 74 0d 09 20 61 |d restor|e it.. a|
|00004d20| 72 6f 75 6e 64 20 63 61 | 6c 6c 73 2c 20 64 6f 20 |round ca|lls, do |
|00004d30| 74 68 61 74 2e 20 20 2a | 2f 0d 20 20 20 20 20 20 |that. *|/. |
|00004d40| 69 66 20 28 21 20 61 63 | 63 65 70 74 5f 63 61 6c |if (! ac|cept_cal|
|00004d50| 6c 5f 63 6c 6f 62 62 65 | 72 65 64 0d 09 20 20 26 |l_clobbe|red.. &|
|00004d60| 26 20 72 65 67 5f 6e 5f | 63 61 6c 6c 73 5f 63 72 |& reg_n_|calls_cr|
|00004d70| 6f 73 73 65 64 5b 61 6c | 6c 6f 63 6e 6f 5f 72 65 |ossed[al|locno_re|
|00004d80| 67 5b 61 6c 6c 6f 63 6e | 6f 5d 5d 20 21 3d 20 30 |g[allocn|o]] != 0|
|00004d90| 0d 09 20 20 26 26 20 43 | 41 4c 4c 45 52 5f 53 41 |.. && C|ALLER_SA|
|00004da0| 56 45 5f 50 52 4f 46 49 | 54 41 42 4c 45 20 28 72 |VE_PROFI|TABLE (r|
|00004db0| 65 67 5f 6e 5f 72 65 66 | 73 5b 61 6c 6c 6f 63 6e |eg_n_ref|s[allocn|
|00004dc0| 6f 5f 72 65 67 5b 61 6c | 6c 6f 63 6e 6f 5d 5d 2c |o_reg[al|locno]],|
|00004dd0| 0d 09 09 09 09 20 20 20 | 20 20 72 65 67 5f 6e 5f |..... | reg_n_|
|00004de0| 63 61 6c 6c 73 5f 63 72 | 6f 73 73 65 64 5b 61 6c |calls_cr|ossed[al|
|00004df0| 6c 6f 63 6e 6f 5f 72 65 | 67 5b 61 6c 6c 6f 63 6e |locno_re|g[allocn|
|00004e00| 6f 5d 5d 29 29 0d 09 7b | 0d 09 20 20 66 69 6e 64 |o]]))..{|.. find|
|00004e10| 5f 72 65 67 20 28 61 6c | 6c 6f 63 6e 6f 2c 20 6c |_reg (al|locno, l|
|00004e20| 6f 73 65 72 73 2c 20 61 | 6c 6c 5f 72 65 67 73 5f |osers, a|ll_regs_|
|00004e30| 70 2c 20 31 2c 20 70 72 | 65 66 72 65 67 73 29 3b |p, 1, pr|efregs);|
|00004e40| 0d 09 20 20 69 66 20 28 | 72 65 67 5f 72 65 6e 75 |.. if (|reg_renu|
|00004e50| 6d 62 65 72 5b 61 6c 6c | 6f 63 6e 6f 5f 72 65 67 |mber[all|ocno_reg|
|00004e60| 5b 61 6c 6c 6f 63 6e 6f | 5d 5d 20 3e 3d 20 30 29 |[allocno|]] >= 0)|
|00004e70| 0d 09 20 20 20 20 63 61 | 6c 6c 65 72 5f 73 61 76 |.. ca|ller_sav|
|00004e80| 65 5f 6e 65 65 64 65 64 | 20 3d 20 31 3b 0d 09 7d |e_needed| = 1;..}|
|00004e90| 0d 20 20 20 20 7d 0d 7d | 0d 0c 0d 2f 2a 20 43 61 |. }.}|.../* Ca|
|00004ea0| 6c 6c 65 64 20 66 72 6f | 6d 20 60 72 65 6c 6f 61 |lled fro|m `reloa|
|00004eb0| 64 27 20 74 6f 20 6c 6f | 6f 6b 20 66 6f 72 20 61 |d' to lo|ok for a|
|00004ec0| 20 68 61 72 64 20 72 65 | 67 20 74 6f 20 70 75 74 | hard re|g to put|
|00004ed0| 20 70 73 65 75 64 6f 20 | 72 65 67 20 52 45 47 4e | pseudo |reg REGN|
|00004ee0| 4f 20 69 6e 2e 0d 20 20 | 20 50 65 72 68 61 70 73 |O in.. | Perhaps|
|00004ef0| 20 69 74 20 68 61 64 20 | 70 72 65 76 69 6f 75 73 | it had |previous|
|00004f00| 6c 79 20 73 65 65 6d 65 | 64 20 6e 6f 74 20 77 6f |ly seeme|d not wo|
|00004f10| 72 74 68 20 61 20 68 61 | 72 64 20 72 65 67 2c 0d |rth a ha|rd reg,.|
|00004f20| 20 20 20 6f 72 20 70 65 | 72 68 61 70 73 20 69 74 | or pe|rhaps it|
|00004f30| 73 20 6f 6c 64 20 68 61 | 72 64 20 72 65 67 20 68 |s old ha|rd reg h|
|00004f40| 61 73 20 62 65 65 6e 20 | 63 6f 6d 6d 61 6e 64 65 |as been |commande|
|00004f50| 65 72 65 64 20 66 6f 72 | 20 72 65 6c 6f 61 64 73 |ered for| reloads|
|00004f60| 2e 0d 20 20 20 46 4f 52 | 42 49 44 44 45 4e 5f 52 |.. FOR|BIDDEN_R|
|00004f70| 45 47 53 20 69 73 20 61 | 20 76 65 63 74 6f 72 20 |EGS is a| vector |
|00004f80| 74 68 61 74 20 69 6e 64 | 69 63 61 74 65 73 20 63 |that ind|icates c|
|00004f90| 65 72 74 61 69 6e 20 68 | 61 72 64 20 72 65 67 73 |ertain h|ard regs|
|00004fa0| 0d 20 20 20 74 68 61 74 | 20 6d 61 79 20 6e 6f 74 |. that| may not|
|00004fb0| 20 62 65 20 75 73 65 64 | 2c 20 65 76 65 6e 20 69 | be used|, even i|
|00004fc0| 66 20 74 68 65 79 20 64 | 6f 20 6e 6f 74 20 61 70 |f they d|o not ap|
|00004fd0| 70 65 61 72 20 74 6f 20 | 62 65 20 61 6c 6c 6f 63 |pear to |be alloc|
|00004fe0| 61 74 65 64 2e 0d 20 20 | 20 41 20 6e 6f 6e 6e 65 |ated.. | A nonne|
|00004ff0| 67 61 74 69 76 65 20 65 | 6c 65 6d 65 6e 74 20 6d |gative e|lement m|
|00005000| 65 61 6e 73 20 74 68 65 | 20 63 6f 72 72 65 73 70 |eans the| corresp|
|00005010| 6f 6e 64 69 6e 67 20 68 | 61 72 64 20 72 65 67 20 |onding h|ard reg |
|00005020| 69 73 20 66 6f 72 62 69 | 64 64 65 6e 2e 0d 20 20 |is forbi|dden.. |
|00005030| 20 49 66 20 46 4f 52 42 | 49 44 44 45 4e 5f 52 45 | If FORB|IDDEN_RE|
|00005040| 47 53 20 69 73 20 7a 65 | 72 6f 2c 20 6e 6f 20 72 |GS is ze|ro, no r|
|00005050| 65 67 73 20 61 72 65 20 | 66 6f 72 62 69 64 64 65 |egs are |forbidde|
|00005060| 6e 2e 20 20 2a 2f 0d 0d | 76 6f 69 64 0d 72 65 74 |n. */..|void.ret|
|00005070| 72 79 5f 67 6c 6f 62 61 | 6c 5f 61 6c 6c 6f 63 20 |ry_globa|l_alloc |
|00005080| 28 72 65 67 6e 6f 2c 20 | 66 6f 72 62 69 64 64 65 |(regno, |forbidde|
|00005090| 6e 5f 72 65 67 73 29 0d | 20 20 20 20 20 69 6e 74 |n_regs).| int|
|000050a0| 20 72 65 67 6e 6f 3b 0d | 20 20 20 20 20 73 68 6f | regno;.| sho|
|000050b0| 72 74 20 2a 66 6f 72 62 | 69 64 64 65 6e 5f 72 65 |rt *forb|idden_re|
|000050c0| 67 73 3b 0d 7b 0d 20 20 | 69 6e 74 20 61 6c 6c 6f |gs;.{. |int allo|
|000050d0| 63 6e 6f 20 3d 20 72 65 | 67 5f 61 6c 6c 6f 63 6e |cno = re|g_allocn|
|000050e0| 6f 5b 72 65 67 6e 6f 5d | 3b 0d 20 20 69 66 20 28 |o[regno]|;. if (|
|000050f0| 61 6c 6c 6f 63 6e 6f 20 | 3e 3d 20 30 29 0d 20 20 |allocno |>= 0). |
|00005100| 20 20 7b 0d 20 20 20 20 | 20 20 2f 2a 20 49 66 20 | {. | /* If |
|00005110| 77 65 20 68 61 76 65 20 | 6d 6f 72 65 20 74 68 61 |we have |more tha|
|00005120| 6e 20 6f 6e 65 20 72 65 | 67 69 73 74 65 72 20 63 |n one re|gister c|
|00005130| 6c 61 73 73 2c 0d 09 20 | 66 69 72 73 74 20 74 72 |lass,.. |first tr|
|00005140| 79 20 61 6c 6c 6f 63 61 | 74 69 6e 67 20 69 6e 20 |y alloca|ting in |
|00005150| 74 68 65 20 63 6c 61 73 | 73 20 74 68 61 74 20 69 |the clas|s that i|
|00005160| 73 20 63 68 65 61 70 65 | 73 74 0d 09 20 66 6f 72 |s cheape|st.. for|
|00005170| 20 74 68 69 73 20 70 73 | 65 75 64 6f 2d 72 65 67 | this ps|eudo-reg|
|00005180| 2e 20 20 49 66 20 74 68 | 61 74 20 66 61 69 6c 73 |. If th|at fails|
|00005190| 2c 20 74 72 79 20 61 6e | 79 20 72 65 67 2e 20 20 |, try an|y reg. |
|000051a0| 2a 2f 0d 20 20 20 20 20 | 20 69 66 20 28 4e 5f 52 |*/. | if (N_R|
|000051b0| 45 47 5f 43 4c 41 53 53 | 45 53 20 3e 20 31 29 0d |EG_CLASS|ES > 1).|
|000051c0| 09 66 69 6e 64 5f 72 65 | 67 20 28 61 6c 6c 6f 63 |.find_re|g (alloc|
|000051d0| 6e 6f 2c 20 66 6f 72 62 | 69 64 64 65 6e 5f 72 65 |no, forb|idden_re|
|000051e0| 67 73 2c 20 30 2c 20 30 | 2c 0d 09 09 20 20 68 61 |gs, 0, 0|,... ha|
|000051f0| 72 64 5f 72 65 67 5f 70 | 72 65 66 65 72 65 6e 63 |rd_reg_p|referenc|
|00005200| 65 73 5b 61 6c 6c 6f 63 | 6e 6f 5d 29 3b 0d 20 20 |es[alloc|no]);. |
|00005210| 20 20 20 20 69 66 20 28 | 72 65 67 5f 72 65 6e 75 | if (|reg_renu|
|00005220| 6d 62 65 72 5b 72 65 67 | 6e 6f 5d 20 3c 20 30 0d |mber[reg|no] < 0.|
|00005230| 09 20 20 26 26 20 21 72 | 65 67 5f 70 72 65 66 65 |. && !r|eg_prefe|
|00005240| 72 72 65 64 5f 6f 72 5f | 6e 6f 74 68 69 6e 67 20 |rred_or_|nothing |
|00005250| 28 72 65 67 6e 6f 29 29 | 0d 09 66 69 6e 64 5f 72 |(regno))|..find_r|
|00005260| 65 67 20 28 61 6c 6c 6f | 63 6e 6f 2c 20 66 6f 72 |eg (allo|cno, for|
|00005270| 62 69 64 64 65 6e 5f 72 | 65 67 73 2c 20 31 2c 20 |bidden_r|egs, 1, |
|00005280| 30 2c 0d 09 09 20 20 68 | 61 72 64 5f 72 65 67 5f |0,... h|ard_reg_|
|00005290| 70 72 65 66 65 72 65 6e | 63 65 73 5b 61 6c 6c 6f |preferen|ces[allo|
|000052a0| 63 6e 6f 5d 29 3b 0d 20 | 20 20 20 7d 0d 7d 0d 0d |cno]);. | }.}..|
|000052b0| 2f 2a 20 43 61 6c 6c 65 | 64 20 66 72 6f 6d 20 72 |/* Calle|d from r|
|000052c0| 65 6c 6f 61 64 20 70 61 | 73 73 20 74 6f 20 73 65 |eload pa|ss to se|
|000052d0| 65 20 69 66 20 63 75 72 | 72 65 6e 74 20 66 75 6e |e if cur|rent fun|
|000052e0| 63 74 69 6f 6e 27 73 20 | 70 73 65 75 64 6f 20 72 |ction's |pseudo r|
|000052f0| 65 67 73 0d 20 20 20 72 | 65 71 75 69 72 65 20 61 |egs. r|equire a|
|00005300| 20 66 72 61 6d 65 20 70 | 6f 69 6e 74 65 72 20 74 | frame p|ointer t|
|00005310| 6f 20 62 65 20 61 6c 6c | 6f 63 61 74 65 64 20 61 |o be all|ocated a|
|00005320| 6e 64 20 73 65 74 20 75 | 70 2e 0d 0d 20 20 20 52 |nd set u|p... R|
|00005330| 65 74 75 72 6e 20 31 20 | 69 66 20 73 6f 2c 20 30 |eturn 1 |if so, 0|
|00005340| 20 6f 74 68 65 72 77 69 | 73 65 2e 0d 20 20 20 57 | otherwi|se.. W|
|00005350| 65 20 6d 61 79 20 61 6c | 74 65 72 20 74 68 65 20 |e may al|ter the |
|00005360| 68 61 72 64 2d 72 65 67 | 20 61 6c 6c 6f 63 61 74 |hard-reg| allocat|
|00005370| 69 6f 6e 20 6f 66 20 74 | 68 65 20 70 73 65 75 64 |ion of t|he pseud|
|00005380| 6f 20 72 65 67 73 0d 20 | 20 20 69 6e 20 6f 72 64 |o regs. | in ord|
|00005390| 65 72 20 74 6f 20 6d 61 | 6b 65 20 74 68 65 20 66 |er to ma|ke the f|
|000053a0| 72 61 6d 65 20 70 6f 69 | 6e 74 65 72 20 75 6e 6e |rame poi|nter unn|
|000053b0| 65 63 65 73 73 61 72 79 | 2e 0d 20 20 20 48 6f 77 |ecessary|.. How|
|000053c0| 65 76 65 72 2c 20 69 66 | 20 74 68 65 20 76 61 6c |ever, if| the val|
|000053d0| 75 65 20 69 73 20 31 2c | 20 6e 6f 74 68 69 6e 67 |ue is 1,| nothing|
|000053e0| 20 68 61 73 20 62 65 65 | 6e 20 61 6c 74 65 72 65 | has bee|n altere|
|000053f0| 64 2e 0d 0d 20 20 20 41 | 72 67 73 20 67 72 61 6e |d... A|rgs gran|
|00005400| 74 20 61 63 63 65 73 73 | 20 74 6f 20 73 6f 6d 65 |t access| to some|
|00005410| 20 74 61 62 6c 65 73 20 | 75 73 65 64 20 69 6e 20 | tables |used in |
|00005420| 72 65 6c 6f 61 64 31 2e | 63 2e 0d 20 20 20 53 65 |reload1.|c.. Se|
|00005430| 65 20 74 68 65 72 65 20 | 66 6f 72 20 69 6e 66 6f |e there |for info|
|00005440| 20 6f 6e 20 74 68 65 6d | 2e 20 20 2a 2f 0d 0d 69 | on them|. */..i|
|00005450| 6e 74 0d 63 68 65 63 6b | 5f 66 72 61 6d 65 5f 70 |nt.check|_frame_p|
|00005460| 6f 69 6e 74 65 72 5f 72 | 65 71 75 69 72 65 64 20 |ointer_r|equired |
|00005470| 28 72 65 67 5f 65 71 75 | 69 76 5f 63 6f 6e 73 74 |(reg_equ|iv_const|
|00005480| 61 6e 74 2c 20 72 65 67 | 5f 65 71 75 69 76 5f 6d |ant, reg|_equiv_m|
|00005490| 65 6d 2c 20 72 65 67 5f | 65 71 75 69 76 5f 61 64 |em, reg_|equiv_ad|
|000054a0| 64 72 65 73 73 29 0d 20 | 20 20 20 20 72 74 78 20 |dress). | rtx |
|000054b0| 2a 72 65 67 5f 65 71 75 | 69 76 5f 63 6f 6e 73 74 |*reg_equ|iv_const|
|000054c0| 61 6e 74 2c 20 2a 72 65 | 67 5f 65 71 75 69 76 5f |ant, *re|g_equiv_|
|000054d0| 6d 65 6d 2c 20 2a 72 65 | 67 5f 65 71 75 69 76 5f |mem, *re|g_equiv_|
|000054e0| 61 64 64 72 65 73 73 3b | 0d 7b 0d 20 20 72 65 67 |address;|.{. reg|
|000054f0| 69 73 74 65 72 20 69 6e | 74 20 69 3b 0d 20 20 48 |ister in|t i;. H|
|00005500| 41 52 44 5f 52 45 47 5f | 53 45 54 20 2a 6f 6c 64 |ARD_REG_|SET *old|
|00005510| 5f 68 61 72 64 5f 72 65 | 67 5f 63 6f 6e 66 6c 69 |_hard_re|g_confli|
|00005520| 63 74 73 3b 0d 20 20 73 | 68 6f 72 74 20 2a 6f 6c |cts;. s|hort *ol|
|00005530| 64 5f 72 65 67 5f 72 65 | 6e 75 6d 62 65 72 3b 0d |d_reg_re|number;.|
|00005540| 20 20 63 68 61 72 20 6f | 6c 64 5f 72 65 67 73 5f | char o|ld_regs_|
|00005550| 65 76 65 72 5f 6c 69 76 | 65 5b 46 49 52 53 54 5f |ever_liv|e[FIRST_|
|00005560| 50 53 45 55 44 4f 5f 52 | 45 47 49 53 54 45 52 5d |PSEUDO_R|EGISTER]|
|00005570| 3b 0d 0d 20 20 2f 2a 20 | 49 66 20 61 6e 79 20 70 |;.. /* |If any p|
|00005580| 73 65 75 64 6f 20 72 65 | 67 20 68 61 73 20 6e 6f |seudo re|g has no|
|00005590| 20 68 61 72 64 20 72 65 | 67 20 61 6e 64 20 6e 6f | hard re|g and no|
|000055a0| 20 65 71 75 69 76 61 6c | 65 6e 74 2c 0d 20 20 20 | equival|ent,. |
|000055b0| 20 20 77 65 20 6d 75 73 | 74 20 68 61 76 65 20 61 | we mus|t have a|
|000055c0| 20 66 72 61 6d 65 20 70 | 6f 69 6e 74 65 72 2e 20 | frame p|ointer. |
|000055d0| 20 2a 2f 0d 0d 20 20 66 | 6f 72 20 28 69 20 3d 20 | */.. f|or (i = |
|000055e0| 46 49 52 53 54 5f 50 53 | 45 55 44 4f 5f 52 45 47 |FIRST_PS|EUDO_REG|
|000055f0| 49 53 54 45 52 3b 20 69 | 20 3c 20 6d 61 78 5f 72 |ISTER; i| < max_r|
|00005600| 65 67 6e 6f 3b 20 69 2b | 2b 29 0d 20 20 20 20 69 |egno; i+|+). i|
|00005610| 66 20 28 72 65 67 5f 72 | 65 6e 75 6d 62 65 72 5b |f (reg_r|enumber[|
|00005620| 69 5d 20 3c 20 30 20 26 | 26 20 72 65 67 5f 6e 5f |i] < 0 &|& reg_n_|
|00005630| 72 65 66 73 5b 69 5d 20 | 3e 20 30 0d 20 20 20 20 |refs[i] |> 0. |
|00005640| 20 20 20 20 26 26 20 72 | 65 67 5f 65 71 75 69 76 | && r|eg_equiv|
|00005650| 5f 6d 65 6d 5b 69 5d 20 | 3d 3d 20 30 20 26 26 20 |_mem[i] |== 0 && |
|00005660| 72 65 67 5f 65 71 75 69 | 76 5f 63 6f 6e 73 74 61 |reg_equi|v_consta|
|00005670| 6e 74 5b 69 5d 20 3d 3d | 20 30 0d 09 26 26 20 72 |nt[i] ==| 0..&& r|
|00005680| 65 67 5f 65 71 75 69 76 | 5f 61 64 64 72 65 73 73 |eg_equiv|_address|
|00005690| 5b 69 5d 20 3d 3d 20 30 | 29 0d 20 20 20 20 20 20 |[i] == 0|). |
|000056a0| 72 65 74 75 72 6e 20 31 | 3b 0d 0d 20 20 2f 2a 20 |return 1|;.. /* |
|000056b0| 49 66 20 77 65 20 6d 69 | 67 68 74 20 6e 6f 74 20 |If we mi|ght not |
|000056c0| 6e 65 65 64 20 61 20 66 | 72 61 6d 65 20 70 6f 69 |need a f|rame poi|
|000056d0| 6e 74 65 72 2c 0d 20 20 | 20 20 20 74 72 79 20 66 |nter,. | try f|
|000056e0| 69 6e 64 69 6e 67 20 61 | 20 68 61 72 64 20 72 65 |inding a| hard re|
|000056f0| 67 20 66 6f 72 20 61 6e | 79 20 70 73 65 75 64 6f |g for an|y pseudo|
|00005700| 20 74 68 61 74 20 68 61 | 73 20 61 20 6d 65 6d 6f | that ha|s a memo|
|00005710| 72 79 20 65 71 75 69 76 | 61 6c 65 6e 74 2e 0d 20 |ry equiv|alent.. |
|00005720| 20 20 20 20 54 68 61 74 | 20 69 73 20 62 65 63 61 | That| is beca|
|00005730| 75 73 65 20 74 68 65 20 | 6d 65 6d 6f 72 79 20 65 |use the |memory e|
|00005740| 71 75 69 76 61 6c 65 6e | 74 20 70 72 6f 62 61 62 |quivalen|t probab|
|00005750| 6c 79 20 72 65 66 65 72 | 73 20 74 6f 20 61 20 66 |ly refer|s to a f|
|00005760| 72 61 6d 65 0d 20 20 20 | 20 20 70 6f 69 6e 74 65 |rame. | pointe|
|00005770| 72 2e 20 20 2a 2f 0d 0d | 20 20 6f 6c 64 5f 72 65 |r. */..| old_re|
|00005780| 67 5f 72 65 6e 75 6d 62 | 65 72 20 3d 20 28 73 68 |g_renumb|er = (sh|
|00005790| 6f 72 74 20 2a 29 20 61 | 6c 6c 6f 63 61 20 28 6d |ort *) a|lloca (m|
|000057a0| 61 78 5f 72 65 67 6e 6f | 20 2a 20 73 69 7a 65 6f |ax_regno| * sizeo|
|000057b0| 66 20 28 73 68 6f 72 74 | 29 29 3b 0d 20 20 6f 6c |f (short|));. ol|
|000057c0| 64 5f 68 61 72 64 5f 72 | 65 67 5f 63 6f 6e 66 6c |d_hard_r|eg_confl|
|000057d0| 69 63 74 73 20 3d 20 28 | 48 41 52 44 5f 52 45 47 |icts = (|HARD_REG|
|000057e0| 5f 53 45 54 20 2a 29 0d | 20 20 20 20 61 6c 6c 6f |_SET *).| allo|
|000057f0| 63 61 20 28 6d 61 78 5f | 61 6c 6c 6f 63 6e 6f 20 |ca (max_|allocno |
|00005800| 2a 20 73 69 7a 65 6f 66 | 20 28 48 41 52 44 5f 52 |* sizeof| (HARD_R|
|00005810| 45 47 5f 53 45 54 29 29 | 3b 0d 0d 20 20 62 63 6f |EG_SET))|;.. bco|
|00005820| 70 79 20 28 72 65 67 5f | 72 65 6e 75 6d 62 65 72 |py (reg_|renumber|
|00005830| 2c 20 6f 6c 64 5f 72 65 | 67 5f 72 65 6e 75 6d 62 |, old_re|g_renumb|
|00005840| 65 72 2c 20 6d 61 78 5f | 72 65 67 6e 6f 20 2a 20 |er, max_|regno * |
|00005850| 73 69 7a 65 6f 66 20 28 | 73 68 6f 72 74 29 29 3b |sizeof (|short));|
|00005860| 0d 20 20 62 63 6f 70 79 | 20 28 68 61 72 64 5f 72 |. bcopy| (hard_r|
|00005870| 65 67 5f 63 6f 6e 66 6c | 69 63 74 73 2c 20 6f 6c |eg_confl|icts, ol|
|00005880| 64 5f 68 61 72 64 5f 72 | 65 67 5f 63 6f 6e 66 6c |d_hard_r|eg_confl|
|00005890| 69 63 74 73 2c 0d 09 20 | 6d 61 78 5f 61 6c 6c 6f |icts,.. |max_allo|
|000058a0| 63 6e 6f 20 2a 20 73 69 | 7a 65 6f 66 20 28 48 41 |cno * si|zeof (HA|
|000058b0| 52 44 5f 52 45 47 5f 53 | 45 54 29 29 3b 0d 20 20 |RD_REG_S|ET));. |
|000058c0| 62 63 6f 70 79 20 28 72 | 65 67 73 5f 65 76 65 72 |bcopy (r|egs_ever|
|000058d0| 5f 6c 69 76 65 2c 20 6f | 6c 64 5f 72 65 67 73 5f |_live, o|ld_regs_|
|000058e0| 65 76 65 72 5f 6c 69 76 | 65 2c 20 73 69 7a 65 6f |ever_liv|e, sizeo|
|000058f0| 66 20 72 65 67 73 5f 65 | 76 65 72 5f 6c 69 76 65 |f regs_e|ver_live|
|00005900| 29 3b 0d 0d 20 20 66 6f | 72 20 28 69 20 3d 20 46 |);.. fo|r (i = F|
|00005910| 49 52 53 54 5f 50 53 45 | 55 44 4f 5f 52 45 47 49 |IRST_PSE|UDO_REGI|
|00005920| 53 54 45 52 3b 20 69 20 | 3c 20 6d 61 78 5f 72 65 |STER; i |< max_re|
|00005930| 67 6e 6f 3b 20 69 2b 2b | 29 0d 20 20 20 20 69 66 |gno; i++|). if|
|00005940| 20 28 72 65 67 5f 72 65 | 6e 75 6d 62 65 72 5b 69 | (reg_re|number[i|
|00005950| 5d 20 3c 20 30 0d 09 26 | 26 20 28 28 72 65 67 5f |] < 0..&|& ((reg_|
|00005960| 65 71 75 69 76 5f 6d 65 | 6d 5b 69 5d 0d 09 20 20 |equiv_me|m[i].. |
|00005970| 20 20 20 26 26 20 72 65 | 67 5f 6d 65 6e 74 69 6f | && re|g_mentio|
|00005980| 6e 65 64 5f 70 20 28 66 | 72 61 6d 65 5f 70 6f 69 |ned_p (f|rame_poi|
|00005990| 6e 74 65 72 5f 72 74 78 | 2c 20 72 65 67 5f 65 71 |nter_rtx|, reg_eq|
|000059a0| 75 69 76 5f 6d 65 6d 5b | 69 5d 29 29 0d 09 20 20 |uiv_mem[|i])).. |
|000059b0| 20 20 7c 7c 20 28 72 65 | 67 5f 65 71 75 69 76 5f | || (re|g_equiv_|
|000059c0| 61 64 64 72 65 73 73 5b | 69 5d 0d 09 09 26 26 20 |address[|i]...&& |
|000059d0| 72 65 67 5f 6d 65 6e 74 | 69 6f 6e 65 64 5f 70 20 |reg_ment|ioned_p |
|000059e0| 28 66 72 61 6d 65 5f 70 | 6f 69 6e 74 65 72 5f 72 |(frame_p|ointer_r|
|000059f0| 74 78 2c 20 72 65 67 5f | 65 71 75 69 76 5f 61 64 |tx, reg_|equiv_ad|
|00005a00| 64 72 65 73 73 5b 69 5d | 29 29 29 29 0d 20 20 20 |dress[i]|)))). |
|00005a10| 20 20 20 7b 0d 09 72 65 | 74 72 79 5f 67 6c 6f 62 | {..re|try_glob|
|00005a20| 61 6c 5f 61 6c 6c 6f 63 | 20 28 69 2c 20 30 29 3b |al_alloc| (i, 0);|
|00005a30| 0d 09 2f 2a 20 49 66 20 | 77 65 20 63 61 6e 27 74 |../* If |we can't|
|00005a40| 20 66 69 6e 64 20 61 20 | 68 61 72 64 20 72 65 67 | find a |hard reg|
|00005a50| 20 66 6f 72 20 41 4c 4c | 20 6f 66 20 74 68 65 6d | for ALL| of them|
|00005a60| 2c 0d 09 20 20 20 6f 72 | 20 69 66 20 61 20 70 72 |,.. or| if a pr|
|00005a70| 65 76 69 6f 75 73 6c 79 | 20 75 6e 6e 65 65 64 65 |eviously| unneede|
|00005a80| 64 20 68 61 72 64 20 72 | 65 67 20 69 73 20 75 73 |d hard r|eg is us|
|00005a90| 65 64 20 74 68 61 74 20 | 72 65 71 75 69 72 65 73 |ed that |requires|
|00005aa0| 20 73 61 76 69 6e 67 2c | 0d 09 20 20 20 77 65 20 | saving,|.. we |
|00005ab0| 66 61 69 6c 3a 20 73 65 | 74 20 61 6c 6c 20 74 68 |fail: se|t all th|
|00005ac0| 6f 73 65 20 70 73 65 75 | 64 6f 73 20 62 61 63 6b |ose pseu|dos back|
|00005ad0| 20 61 73 20 74 68 65 79 | 20 77 65 72 65 2e 20 20 | as they| were. |
|00005ae0| 2a 2f 0d 09 69 66 20 28 | 72 65 67 5f 72 65 6e 75 |*/..if (|reg_renu|
|00005af0| 6d 62 65 72 5b 69 5d 20 | 3c 20 30 0d 09 20 20 20 |mber[i] |< 0.. |
|00005b00| 20 7c 7c 20 28 21 20 6f | 6c 64 5f 72 65 67 73 5f | || (! o|ld_regs_|
|00005b10| 65 76 65 72 5f 6c 69 76 | 65 5b 72 65 67 5f 72 65 |ever_liv|e[reg_re|
|00005b20| 6e 75 6d 62 65 72 5b 69 | 5d 5d 0d 09 09 26 26 20 |number[i|]]...&& |
|00005b30| 21 20 63 61 6c 6c 5f 75 | 73 65 64 5f 72 65 67 73 |! call_u|sed_regs|
|00005b40| 5b 72 65 67 5f 72 65 6e | 75 6d 62 65 72 5b 69 5d |[reg_ren|umber[i]|
|00005b50| 5d 29 29 0d 09 20 20 7b | 0d 09 20 20 20 20 62 63 |])).. {|.. bc|
|00005b60| 6f 70 79 20 28 6f 6c 64 | 5f 72 65 67 5f 72 65 6e |opy (old|_reg_ren|
|00005b70| 75 6d 62 65 72 2c 20 72 | 65 67 5f 72 65 6e 75 6d |umber, r|eg_renum|
|00005b80| 62 65 72 2c 0d 09 09 20 | 20 20 6d 61 78 5f 72 65 |ber,... | max_re|
|00005b90| 67 6e 6f 20 2a 20 73 69 | 7a 65 6f 66 20 28 73 68 |gno * si|zeof (sh|
|00005ba0| 6f 72 74 29 29 3b 0d 09 | 20 20 20 20 62 63 6f 70 |ort));..| bcop|
|00005bb0| 79 20 28 6f 6c 64 5f 68 | 61 72 64 5f 72 65 67 5f |y (old_h|ard_reg_|
|00005bc0| 63 6f 6e 66 6c 69 63 74 | 73 2c 20 68 61 72 64 5f |conflict|s, hard_|
|00005bd0| 72 65 67 5f 63 6f 6e 66 | 6c 69 63 74 73 2c 0d 09 |reg_conf|licts,..|
|00005be0| 09 20 20 20 6d 61 78 5f | 61 6c 6c 6f 63 6e 6f 20 |. max_|allocno |
|00005bf0| 2a 20 73 69 7a 65 6f 66 | 20 28 48 41 52 44 5f 52 |* sizeof| (HARD_R|
|00005c00| 45 47 5f 53 45 54 29 29 | 3b 0d 09 20 20 20 20 62 |EG_SET))|;.. b|
|00005c10| 63 6f 70 79 20 28 6f 6c | 64 5f 72 65 67 73 5f 65 |copy (ol|d_regs_e|
|00005c20| 76 65 72 5f 6c 69 76 65 | 2c 20 72 65 67 73 5f 65 |ver_live|, regs_e|
|00005c30| 76 65 72 5f 6c 69 76 65 | 2c 20 73 69 7a 65 6f 66 |ver_live|, sizeof|
|00005c40| 20 72 65 67 73 5f 65 76 | 65 72 5f 6c 69 76 65 29 | regs_ev|er_live)|
|00005c50| 3b 0d 09 20 20 20 20 72 | 65 74 75 72 6e 20 31 3b |;.. r|eturn 1;|
|00005c60| 0d 09 20 20 7d 0d 09 6d | 61 72 6b 5f 68 6f 6d 65 |.. }..m|ark_home|
|00005c70| 5f 6c 69 76 65 20 28 69 | 29 3b 0d 20 20 20 20 20 |_live (i|);. |
|00005c80| 20 7d 0d 0d 20 20 72 65 | 74 75 72 6e 20 30 3b 0d | }.. re|turn 0;.|
|00005c90| 7d 0d 0c 0d 2f 2a 20 52 | 65 63 6f 72 64 20 61 20 |}.../* R|ecord a |
|00005ca0| 63 6f 6e 66 6c 69 63 74 | 20 62 65 74 77 65 65 6e |conflict| between|
|00005cb0| 20 72 65 67 69 73 74 65 | 72 20 52 45 47 4e 4f 0d | registe|r REGNO.|
|00005cc0| 20 20 20 61 6e 64 20 65 | 76 65 72 79 74 68 69 6e | and e|verythin|
|00005cd0| 67 20 63 75 72 72 65 6e | 74 6c 79 20 6c 69 76 65 |g curren|tly live|
|00005ce0| 2e 0d 20 20 20 52 45 47 | 4e 4f 20 6d 75 73 74 20 |.. REG|NO must |
|00005cf0| 6e 6f 74 20 62 65 20 61 | 20 70 73 65 75 64 6f 20 |not be a| pseudo |
|00005d00| 72 65 67 20 74 68 61 74 | 20 77 61 73 20 61 6c 6c |reg that| was all|
|00005d10| 6f 63 61 74 65 64 0d 20 | 20 20 62 79 20 6c 6f 63 |ocated. | by loc|
|00005d20| 61 6c 5f 61 6c 6c 6f 63 | 3b 20 73 75 63 68 20 6e |al_alloc|; such n|
|00005d30| 75 6d 62 65 72 73 20 6d | 75 73 74 20 62 65 20 74 |umbers m|ust be t|
|00005d40| 72 61 6e 73 6c 61 74 65 | 64 20 74 68 72 6f 75 67 |ranslate|d throug|
|00005d50| 68 0d 20 20 20 72 65 67 | 5f 72 65 6e 75 6d 62 65 |h. reg|_renumbe|
|00005d60| 72 20 62 65 66 6f 72 65 | 20 63 61 6c 6c 69 6e 67 |r before| calling|
|00005d70| 20 68 65 72 65 2e 20 20 | 2a 2f 0d 0d 73 74 61 74 | here. |*/..stat|
|00005d80| 69 63 20 76 6f 69 64 0d | 72 65 63 6f 72 64 5f 6f |ic void.|record_o|
|00005d90| 6e 65 5f 63 6f 6e 66 6c | 69 63 74 20 28 72 65 67 |ne_confl|ict (reg|
|00005da0| 6e 6f 29 0d 20 20 20 20 | 20 69 6e 74 20 72 65 67 |no). | int reg|
|00005db0| 6e 6f 3b 0d 7b 0d 20 20 | 72 65 67 69 73 74 65 72 |no;.{. |register|
|00005dc0| 20 69 6e 74 20 6a 3b 0d | 0d 20 20 69 66 20 28 72 | int j;.|. if (r|
|00005dd0| 65 67 6e 6f 20 3c 20 46 | 49 52 53 54 5f 50 53 45 |egno < F|IRST_PSE|
|00005de0| 55 44 4f 5f 52 45 47 49 | 53 54 45 52 29 0d 20 20 |UDO_REGI|STER). |
|00005df0| 20 20 2f 2a 20 57 68 65 | 6e 20 61 20 68 61 72 64 | /* Whe|n a hard|
|00005e00| 20 72 65 67 69 73 74 65 | 72 20 62 65 63 6f 6d 65 | registe|r become|
|00005e10| 73 20 6c 69 76 65 2c 0d | 20 20 20 20 20 20 20 72 |s live,.| r|
|00005e20| 65 63 6f 72 64 20 63 6f | 6e 66 6c 69 63 74 73 20 |ecord co|nflicts |
|00005e30| 77 69 74 68 20 6c 69 76 | 65 20 70 73 65 75 64 6f |with liv|e pseudo|
|00005e40| 20 72 65 67 73 2e 20 20 | 2a 2f 0d 20 20 20 20 66 | regs. |*/. f|
|00005e50| 6f 72 20 28 6a 20 3d 20 | 30 3b 20 6a 20 3c 20 6d |or (j = |0; j < m|
|00005e60| 61 78 5f 61 6c 6c 6f 63 | 6e 6f 3b 20 6a 2b 2b 29 |ax_alloc|no; j++)|
|00005e70| 0d 20 20 20 20 20 20 7b | 0d 09 69 66 20 28 41 4c |. {|..if (AL|
|00005e80| 4c 4f 43 4e 4f 5f 4c 49 | 56 45 5f 50 20 28 6a 29 |LOCNO_LI|VE_P (j)|
|00005e90| 29 0d 09 20 20 53 45 54 | 5f 48 41 52 44 5f 52 45 |).. SET|_HARD_RE|
|00005ea0| 47 5f 42 49 54 20 28 68 | 61 72 64 5f 72 65 67 5f |G_BIT (h|ard_reg_|
|00005eb0| 63 6f 6e 66 6c 69 63 74 | 73 5b 6a 5d 2c 20 72 65 |conflict|s[j], re|
|00005ec0| 67 6e 6f 29 3b 0d 20 20 | 20 20 20 20 7d 0d 20 20 |gno);. | }. |
|00005ed0| 65 6c 73 65 0d 20 20 20 | 20 2f 2a 20 57 68 65 6e |else. | /* When|
|00005ee0| 20 61 20 70 73 65 75 64 | 6f 2d 72 65 67 69 73 74 | a pseud|o-regist|
|00005ef0| 65 72 20 62 65 63 6f 6d | 65 73 20 6c 69 76 65 2c |er becom|es live,|
|00005f00| 0d 20 20 20 20 20 20 20 | 72 65 63 6f 72 64 20 63 |. |record c|
|00005f10| 6f 6e 66 6c 69 63 74 73 | 20 66 69 72 73 74 20 77 |onflicts| first w|
|00005f20| 69 74 68 20 68 61 72 64 | 20 72 65 67 73 2c 0d 20 |ith hard| regs,. |
|00005f30| 20 20 20 20 20 20 74 68 | 65 6e 20 77 69 74 68 20 | th|en with |
|00005f40| 6f 74 68 65 72 20 70 73 | 65 75 64 6f 20 72 65 67 |other ps|eudo reg|
|00005f50| 73 2e 20 20 2a 2f 0d 20 | 20 20 20 7b 0d 20 20 20 |s. */. | {. |
|00005f60| 20 20 20 72 65 67 69 73 | 74 65 72 20 69 6e 74 20 | regis|ter int |
|00005f70| 69 61 6c 6c 6f 63 20 3d | 20 72 65 67 5f 61 6c 6c |ialloc =| reg_all|
|00005f80| 6f 63 6e 6f 5b 72 65 67 | 6e 6f 5d 3b 0d 20 20 20 |ocno[reg|no];. |
|00005f90| 20 20 20 72 65 67 69 73 | 74 65 72 20 69 6e 74 20 | regis|ter int |
|00005fa0| 69 61 6c 6c 6f 63 5f 70 | 72 6f 64 20 3d 20 69 61 |ialloc_p|rod = ia|
|00005fb0| 6c 6c 6f 63 20 2a 20 61 | 6c 6c 6f 63 6e 6f 5f 72 |lloc * a|llocno_r|
|00005fc0| 6f 77 5f 77 6f 72 64 73 | 3b 0d 20 20 20 20 20 20 |ow_words|;. |
|00005fd0| 49 4f 52 5f 48 41 52 44 | 5f 52 45 47 5f 53 45 54 |IOR_HARD|_REG_SET|
|00005fe0| 20 28 68 61 72 64 5f 72 | 65 67 5f 63 6f 6e 66 6c | (hard_r|eg_confl|
|00005ff0| 69 63 74 73 5b 69 61 6c | 6c 6f 63 5d 2c 20 68 61 |icts[ial|loc], ha|
|00006000| 72 64 5f 72 65 67 73 5f | 6c 69 76 65 29 3b 0d 20 |rd_regs_|live);. |
|00006010| 20 20 20 20 20 66 6f 72 | 20 28 6a 20 3d 20 61 6c | for| (j = al|
|00006020| 6c 6f 63 6e 6f 5f 72 6f | 77 5f 77 6f 72 64 73 20 |locno_ro|w_words |
|00006030| 2d 20 31 3b 20 6a 20 3e | 3d 20 30 3b 20 6a 2d 2d |- 1; j >|= 0; j--|
|00006040| 29 0d 09 63 6f 6e 66 6c | 69 63 74 73 5b 69 61 6c |)..confl|icts[ial|
|00006050| 6c 6f 63 5f 70 72 6f 64 | 20 2b 20 6a 5d 20 7c 3d |loc_prod| + j] |=|
|00006060| 20 61 6c 6c 6f 63 6e 6f | 73 5f 6c 69 76 65 5b 6a | allocno|s_live[j|
|00006070| 5d 3b 0d 20 20 20 20 7d | 0d 7d 0d 0d 2f 2a 20 52 |];. }|.}../* R|
|00006080| 65 63 6f 72 64 20 61 6c | 6c 20 61 6c 6c 6f 63 6e |ecord al|l allocn|
|00006090| 6f 73 20 63 75 72 72 65 | 6e 74 6c 79 20 6c 69 76 |os curre|ntly liv|
|000060a0| 65 20 61 73 20 63 6f 6e | 66 6c 69 63 74 69 6e 67 |e as con|flicting|
|000060b0| 0d 20 20 20 77 69 74 68 | 20 65 61 63 68 20 6f 74 |. with| each ot|
|000060c0| 68 65 72 20 61 6e 64 20 | 77 69 74 68 20 61 6c 6c |her and |with all|
|000060d0| 20 68 61 72 64 20 72 65 | 67 73 20 63 75 72 72 65 | hard re|gs curre|
|000060e0| 6e 74 6c 79 20 6c 69 76 | 65 2e 0d 20 20 20 41 4c |ntly liv|e.. AL|
|000060f0| 4c 4f 43 4e 4f 5f 56 45 | 43 20 69 73 20 61 20 76 |LOCNO_VE|C is a v|
|00006100| 65 63 74 6f 72 20 6f 66 | 20 4c 45 4e 20 61 6c 6c |ector of| LEN all|
|00006110| 6f 63 6e 6f 73 2c 20 61 | 6c 6c 20 61 6c 6c 6f 63 |ocnos, a|ll alloc|
|00006120| 6e 6f 73 20 74 68 61 74 | 0d 20 20 20 61 72 65 20 |nos that|. are |
|00006130| 63 75 72 72 65 6e 74 6c | 79 20 6c 69 76 65 2e 20 |currentl|y live. |
|00006140| 20 54 68 65 69 72 20 62 | 69 74 73 20 61 72 65 20 | Their b|its are |
|00006150| 61 6c 73 6f 20 66 6c 61 | 67 67 65 64 20 69 6e 20 |also fla|gged in |
|00006160| 61 6c 6c 6f 63 6e 6f 73 | 5f 6c 69 76 65 2e 20 20 |allocnos|_live. |
|00006170| 2a 2f 0d 0d 73 74 61 74 | 69 63 20 76 6f 69 64 0d |*/..stat|ic void.|
|00006180| 72 65 63 6f 72 64 5f 63 | 6f 6e 66 6c 69 63 74 73 |record_c|onflicts|
|00006190| 20 28 61 6c 6c 6f 63 6e | 6f 5f 76 65 63 2c 20 6c | (allocn|o_vec, l|
|000061a0| 65 6e 29 0d 20 20 20 20 | 20 72 65 67 69 73 74 65 |en). | registe|
|000061b0| 72 20 73 68 6f 72 74 20 | 2a 61 6c 6c 6f 63 6e 6f |r short |*allocno|
|000061c0| 5f 76 65 63 3b 0d 20 20 | 20 20 20 72 65 67 69 73 |_vec;. | regis|
|000061d0| 74 65 72 20 69 6e 74 20 | 6c 65 6e 3b 0d 7b 0d 20 |ter int |len;.{. |
|000061e0| 20 72 65 67 69 73 74 65 | 72 20 69 6e 74 20 61 6c | registe|r int al|
|000061f0| 6c 6f 63 6e 6f 3b 0d 20 | 20 72 65 67 69 73 74 65 |locno;. | registe|
|00006200| 72 20 69 6e 74 20 6a 3b | 0d 20 20 72 65 67 69 73 |r int j;|. regis|
|00006210| 74 65 72 20 69 6e 74 20 | 69 61 6c 6c 6f 63 5f 70 |ter int |ialloc_p|
|00006220| 72 6f 64 3b 0d 0d 20 20 | 77 68 69 6c 65 20 28 2d |rod;.. |while (-|
|00006230| 2d 6c 65 6e 20 3e 3d 20 | 30 29 0d 20 20 20 20 7b |-len >= |0). {|
|00006240| 0d 20 20 20 20 20 20 61 | 6c 6c 6f 63 6e 6f 20 3d |. a|llocno =|
|00006250| 20 61 6c 6c 6f 63 6e 6f | 5f 76 65 63 5b 6c 65 6e | allocno|_vec[len|
|00006260| 5d 3b 0d 20 20 20 20 20 | 20 69 61 6c 6c 6f 63 5f |];. | ialloc_|
|00006270| 70 72 6f 64 20 3d 20 61 | 6c 6c 6f 63 6e 6f 20 2a |prod = a|llocno *|
|00006280| 20 61 6c 6c 6f 63 6e 6f | 5f 72 6f 77 5f 77 6f 72 | allocno|_row_wor|
|00006290| 64 73 3b 0d 20 20 20 20 | 20 20 49 4f 52 5f 48 41 |ds;. | IOR_HA|
|000062a0| 52 44 5f 52 45 47 5f 53 | 45 54 20 28 68 61 72 64 |RD_REG_S|ET (hard|
|000062b0| 5f 72 65 67 5f 63 6f 6e | 66 6c 69 63 74 73 5b 61 |_reg_con|flicts[a|
|000062c0| 6c 6c 6f 63 6e 6f 5d 2c | 20 68 61 72 64 5f 72 65 |llocno],| hard_re|
|000062d0| 67 73 5f 6c 69 76 65 29 | 3b 0d 20 20 20 20 20 20 |gs_live)|;. |
|000062e0| 66 6f 72 20 28 6a 20 3d | 20 61 6c 6c 6f 63 6e 6f |for (j =| allocno|
|000062f0| 5f 72 6f 77 5f 77 6f 72 | 64 73 20 2d 20 31 3b 20 |_row_wor|ds - 1; |
|00006300| 6a 20 3e 3d 20 30 3b 20 | 6a 2d 2d 29 0d 09 63 6f |j >= 0; |j--)..co|
|00006310| 6e 66 6c 69 63 74 73 5b | 69 61 6c 6c 6f 63 5f 70 |nflicts[|ialloc_p|
|00006320| 72 6f 64 20 2b 20 6a 5d | 20 7c 3d 20 61 6c 6c 6f |rod + j]| |= allo|
|00006330| 63 6e 6f 73 5f 6c 69 76 | 65 5b 6a 5d 3b 0d 20 20 |cnos_liv|e[j];. |
|00006340| 20 20 7d 0d 7d 0d 0c 0d | 2f 2a 20 48 61 6e 64 6c | }.}...|/* Handl|
|00006350| 65 20 74 68 65 20 63 61 | 73 65 20 77 68 65 72 65 |e the ca|se where|
|00006360| 20 52 45 47 20 69 73 20 | 73 65 74 20 62 79 20 74 | REG is |set by t|
|00006370| 68 65 20 69 6e 73 6e 20 | 62 65 69 6e 67 20 73 63 |he insn |being sc|
|00006380| 61 6e 6e 65 64 2c 0d 20 | 20 20 64 75 72 69 6e 67 |anned,. | during|
|00006390| 20 74 68 65 20 66 6f 72 | 77 61 72 64 20 73 63 61 | the for|ward sca|
|000063a0| 6e 20 74 6f 20 61 63 63 | 75 6d 75 6c 61 74 65 20 |n to acc|umulate |
|000063b0| 63 6f 6e 66 6c 69 63 74 | 73 2e 0d 20 20 20 53 74 |conflict|s.. St|
|000063c0| 6f 72 65 20 61 20 31 20 | 69 6e 20 72 65 67 73 5f |ore a 1 |in regs_|
|000063d0| 6c 69 76 65 20 6f 72 20 | 61 6c 6c 6f 63 6e 6f 73 |live or |allocnos|
|000063e0| 5f 6c 69 76 65 20 66 6f | 72 20 74 68 69 73 20 72 |_live fo|r this r|
|000063f0| 65 67 69 73 74 65 72 2c | 20 72 65 63 6f 72 64 20 |egister,| record |
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.